Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

NCrunch not ignoring unloaded projects
willapp
#1 Posted : Wednesday, February 07, 2018 9:20:31 AM(UTC)
Rank: Member

Groups: Registered
Joined: 7/27/2012(UTC)
Posts: 15
Location: UK

Was thanked: 4 time(s) in 4 post(s)
Hi,

I'm not sure if this is a bug or by design, but I have a large solution (139 projects) and to improve general performance of VS I often unload projects I'm not working on. However, NCrunch seems to always load 139 projects and attempt to build them. Is this intentional?

I could create separate solution files I know, but the projects I need vary from day-to-day, and switching solutions is more effort than just reloading the projects when I need them.

Is there a way NCrunch can ignore projects that aren't loaded so it builds and runs tests faster?

FYI this is a standard .NET 4.5 solution with a mix of web applications, class libraries and unit test projects.

Cheers,
Will.
Remco
#2 Posted : Wednesday, February 07, 2018 11:45:33 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,044

Thanks: 672 times
Was thanked: 796 time(s) in 757 post(s)
Hi Will,

NCrunch sources its list of projects from the solution file, and will also expand its project list to include those projects that exist outside the solution but are referenced from within it. So basically, you get everything in the whole tree regardless of whether VS has the project loaded or not. Unloading and reloading projects dynamically to save resources doesn't work well with NCrunch because NCrunch is both a build-time and run-time tool that cannot produce sensible results unless all dependencies are resolved. Unloading projects also causes problems with retaining important state (such as coverage information), since once a project is gone, we are left with the question of whether or not the details it contained are still relevant. These issues make NCrunch quite different from something like an IDE, where non-resolution patterns can be more sensibly handled and results are usually not as expensive to recalculate/reproduce if they are thrown away.

It's possible to selectively choose which projects are loaded by NCrunch using the Ignore this component completely NCrunch configuration setting. Note that doing this on projects further down your project tree will result in dependency resolution and build errors.

If you're seeking to keep projects unloaded to try and keep NCrunch's resource consumption in the IDE down, note that this may not be very worthwhile. NCrunch stores an absolute minimal amount of data inside the IDE - only details critical to rendering a functional UI. All the actual storage and processing of project information happens inside the NCrunch engine process, where it is highly optimised. Improvements in system-wide performance and resource efficiency are usually better achieved by being more selective about which tests are run automatically by the engine, and by how many execution threads are used on the local machine (distributed processing is a huge help).
willapp
#3 Posted : Wednesday, February 07, 2018 12:23:15 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/27/2012(UTC)
Posts: 15
Location: UK

Was thanked: 4 time(s) in 4 post(s)
Hi Remco,

Thanks for the reply. Not sure I fully understand the reasons for not selectively loading projects, but if you're happy this is the intended behaviour then I'll live with it. The performance issue is mainly around how long NCrunch can take to build our web applications rather than how long it takes to execute tests (I tend to ignore all tests by default and selectively enable ones I want to run anyway, which is a workflow I'm happy with). Our solution has about 15 web applications, some of which are large, and even on my 8 core i7 with 4 cores assigned to NCrunch it still takes several minutes to build them all. As I switch branches often, this adds up over time.

I understand if some projects were unloaded then it might cause build issues (e.g. having a test project loaded but not its dependent web application) but this would be the same behaviour as VS so I never unload projects in such a way that this happens. Also you mentioned what happens to state but I would expect if a project was unloaded then you would lose the state (e.g. coverage) for that assembly, this seems logical to me.

Just wanted to get your feedback but it's not the end of the world, I just like to squeeze every drop of performance I can out of my workflows! :)

Cheers,
Will
Remco
#4 Posted : Wednesday, February 07, 2018 12:32:34 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,044

Thanks: 672 times
Was thanked: 796 time(s) in 757 post(s)
I understand about what you mean about the build times, especially if you're switching branches.

Working on partially loaded solutions adds considerable complexity to the workflow and it can be difficult to design a tool around these kinds of use cases. I tend to try to look at the reasons for why people would want to partially load instead, and try to understand the bigger picture. Knowing that this is to try and cut down on your initial build times is worthwhile and I'll take that on board. Thanks for your comments :)
willapp
#5 Posted : Wednesday, February 07, 2018 1:44:58 PM(UTC)
Rank: Member

Groups: Registered
Joined: 7/27/2012(UTC)
Posts: 15
Location: UK

Was thanked: 4 time(s) in 4 post(s)
Ok thanks. As I said if this is currently by design then that's cool - I raised it thinking it might be a bug. However if there is anything you could do to support it in the future, then I would certainly appreciate it but I know my use-case probably isn't that common.

Cheers,
Will
1 user thanked willapp for this useful post.
Remco on 2/7/2018(UTC)
Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.036 seconds.