-
Notifications
You must be signed in to change notification settings - Fork 223
Slow Razor Build Times #2406
Comments
From @pranavkm on June 5, 2018 17:26 cc @mkArtakMSFT. Issue belongs to Razor |
@ajaybhargavb, can you please investigate this? Thanks! |
@mkArtakMSFT I'm experiencing the same behavior, even when the changes are not in any
Build times vary from 20 to 50 seconds. It makes developing pretty unbearable. The behavior seems not to be consistent though.
|
The slow build times reproduce in Visual Studio 15.7.3 as well. |
@henkmollema, are you creating your project with |
@ajaybhargavb it repros with an existing application as well as with any clean |
Might be useful: when you cancel the build with
|
This issue does not reproduce with 2.0 tooling (e.g. |
I am having a hard time reproducing it. How frequently does this happen? |
It seems to be consistent since I've said that, haha. 😅 It reproduces with any
|
That's interesting. I can't get it to slow down even once. I'll try it on a clean machine.
|
Could you run |
The stack trace shows that it's stuck here when I cancel in the middle of building: Razor/src/Microsoft.AspNetCore.Razor.Tasks/DotnetToolTask.cs Lines 155 to 156 in dc76027
This calls into:
Which is a task with a time-out of 20 seconds:
And every slow build is at least 20 seconds long. Any idea? |
@henkmollema could you try adding |
Thanks @henkmollema - that's great info. Also for anyone who wants an unblocker on this - you can set @ajaybhargavb - my best guess is that the build server is failing to start or failing to respond. For instance if the build server crashes before starting to listen - would we wait the whole 20 sec? This timeout should probably be adjusted |
@pranavkm yep that's it. Build times are back to normal after I added that. |
My build times around 20, 40 or 60 seconds makes sense now. It seems that it re-attempts to launch the server and eventually it succeeds. I wonder why it's having trouble launching it almost every time though. Could be an issue with my local machine? |
We wait the whole 20 seconds only when it is trying to connect to the named pipe for the first time when the server starts. Every other time we only wait 1 second. If the server crashes, we immediately fallback to in-process execution. My guess is that it's stuck here for 20 seconds and then it gives up.
Agreed |
Running
|
@henkmollema - would you mind checking the event log? Do you see crashes in there from |
It seems that it tries again, as my build times vary from ~20 seconds and ~40 seconds. |
@rynowak I can't find any |
The full build output for the failing task part: https://pastebin.com/2kSUP5Ah. |
I suspect there is something wacky going on with the pipe it tries to connect to. @henkmollema, would you mind running |
I can confirm that adding the |
We've started a separate discussion about the pipe issue with some folks from CoreFX. |
I found the actual cause of this. I was passing the pipe name directly as argument instead of within quotes 🤦♂️ https://github.com/aspnet/Razor/pull/2409/files#diff-685762d07aeab591272fec7135b4d5f3R293. This has nothing to do with corefx. |
Wooops! Haha, we've all been there. |
Merged in dev 17e3aa8. Keeping the issue open to track porting the fix to the patch. |
Approved for 2.1.3. |
I ran into the same issue with ASP.NET Core 2.1 in Visual Studio 2017 v15.7.4 and at the command line. Unfortunately, my initial searches didn't turn up this issue. I figured out a couple of workarounds and Thank-you for figuring out the underlying issue was with usernames containing a space. I didn't get that far. Thanks for getting this fixed for 2.1.3 as well. |
You can also put a |
Did you mean .NET Core 2.1.3 or ASP.NET Core 2.1.3? It seems that it did not make it into .NET Core 2.1.3. In case of the latter, when is this planned? |
@henkmollema 2.1.3 has not shipped yet. I believe it's slated for later this month. (BTW, it's the version of both of the runtimes.) |
My bad, I mislooked at my version number... 😊 |
From @barrettg on June 5, 2018 16:45
I am experiencing very slow build times after installing the 2.1 SDK on my Windows machine. I'm creating a new project with
dotnet new mvc -au Individual
and then building withdotnet build /clp:performancesummary
. It seems the Razor build engine is the source of the problem:The text was updated successfully, but these errors were encountered: