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

Notification

Icon
Error

How to diagnose why ncrunch build takes so long?
thomasmaisel
#1 Posted : Thursday, May 30, 2019 7:41:48 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/9/2016(UTC)
Posts: 5
Location: Germany

Thanks: 1 times
Hi.

My problem is, that a particular project takes 3 Minutes to Build in NCrunch, while it takes only a few seconds to build in VS2019.

It's an ASP.NET Core project with Angular client app, so there are two things that might be an issue:
- It might build the client files which might take so long (it shouldn't build them, since this build is only enabled in Release Mode)
- It might have trouble with thousands of node_modules which are in the project files (I also tried to exclude *.js / *.ts with no effect)

Is there any way to get a NCrunch Build output to diagnose why it takes so long?
Remco
#2 Posted : Thursday, May 30, 2019 7:46:30 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi,

Yes, you can get a more detailed look at the build, and you definitely should.

Set your Log Verbosity configuration setting to 'Detailed' then let the NCrunch build run and examine the log in the Processing Queue Window. Probably, there is a step somewhere that is eating a lot of time, and probably it won't be needed and could be downsized or deactivated.
1 user thanked Remco for this useful post.
thomasmaisel on 5/30/2019(UTC)
thomasmaisel
#3 Posted : Thursday, May 30, 2019 10:40:13 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 12/9/2016(UTC)
Posts: 5
Location: Germany

Thanks: 1 times
Thank you for the hint. Increasing the log verbosity in the general configuration helped me identifying the problem.

The solution:

The .csproj file had a section which ensured that node packages are installed.

Executing "npm install" manually finishes in 10 seconds, but in NCrunch it takes 2,5 minutes.

I added
Code:
And !('$(NCRUNCH)' == '1')
to the following section's Condition and NCrunch works fine as usual ;-)

Code:
<Target Name="DebugEnsureNodeEnv" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(SpaRoot)node_modules') ">
    <!-- Ensure Node.js is installed -->
    <Exec Command="node --version" ContinueOnError="true">
      <Output TaskParameter="ExitCode" PropertyName="ErrorCode" />
    </Exec>
    <Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your command prompt or IDE." />
    <Message Importance="high" Text="Restoring dependencies using 'npm'. This may take several minutes..." />
    <Exec WorkingDirectory="$(SpaRoot)" Command="npm install" />
  </Target>
Remco
#4 Posted : Thursday, May 30, 2019 11:26:11 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Good find and nicely fixed :)
Users browsing this topic
Guest
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.030 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download