-
-
Notifications
You must be signed in to change notification settings - Fork 726
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cake Build Tool's Startup is Slow - 25s (64% overhead) #2179
Comments
I feel this pain. This has been pushing me recently toward the idea of precompiling binaries and distributing them via NuGet feed, turning the Cake script into a glorified settings file. |
I cloned repo tried the same on my Machine, first run
Next run
|
WIthout bootstrapper
|
My results on a clean clone of the repository on a 4G mobile connection (I'm currently at a Café).
|
Tried on a Windows Machine i7 2.8GHz no SSD, previous was on a Mac Pro 2016 1st run
2nd run
Without bootstrapper
|
Looking at the times where both a total from Cake and from timing the command were provided, even on the much faster machines than mine, it took 2s to 3.5s of overhead and this was 30%-40% of the total time. Also, while an up to date run build time of 7s is much better than what I'm getting on my machine. It is still a very long time if what you want to do is build frequently as you write code to get feedback and that is a starting number for a very simple build. My concrete suggestions would be:
|
If you want continuous real time builds it would probably make sense to have cake process running and have things in a loop, iterations triggered by i.e. user input, file watcher event etc. Your suggestions sounds like good avenues to pursue, if you to we'll happily review your findings in a PR. Near future the Cake team has other features prioritized, we might do some refactoring around roslyn script handling, but for now I'll mark this as up for grabs. |
I got a new laptop:
First run:
second run:
Additional runs show similar times. While this is much faster overall, almost 4 seconds of overhead time seems totally ridiculous on a brand new, gaming laptop. Cake is 58% of the runtime for the second run. Perhaps the actual slow down is network? |
@WalkerCodeRanger These are the same run from my Windows Laptop with about the same specs. 4 seconds "overhead" seems reasonable to me if you take into account what is done (processing files, checking nuget packages, compiling scripts, executing said script)
Second run:
|
Out of interest... what would you deem as acceptable? |
This is what I got on a 2 year old Intel nuc i7 with SSD First run:
Second run:
Sure could be network related. Could be Antimalware/virus kicking in too, in those cases hard to optimize Cake for that. I have nothing against better performance (and we'll happily look at taking contributions in this area), but IMHO think it's currently good enough for is to put focus elsewhere. |
Reran it on another machine HP Envy i7, 8gbs ram and SSD
Second run
Doing a And then
That's a zero dependency console application just containing Console.WriteLine("Hello World!"); |
I'm currently using Cake in a large project with many subproject where the overhead (of 4 to 5 seconds) gets multiplied by the number of projects. Even if nothing has changed in any of the projects (thus no rebuild necessary and the build passes within milliseconds), This results in a built time of a few minutes when nothing has changed. |
I'm seeing in the region of an overhead of ~2s compared per invocation after the first with cake 3.1.0, which is quite a lot on a modern machine |
What You Are Seeing?
When I clone the example repo, and time the build command, there is A LOT of overhead time on the build even after repeated builds so it has had a chance to download everything and cache anything. That is, a lot of the time is spent loading cake and compiling the build script. See below for exact numbers.
What is Expected?
There should be less than a couple seconds of overhead from the build tool. 25s might be acceptable for a build on a build server, but it is unacceptable for a workflow where you repeatedly run the build locally each time you need feedback on compilation errors. You can't be waiting half a minute for every build to even start.
What version of Cake are you using?
v0.28.0
Are you running on a 32 or 64 bit system?
64 Bit
What environment are you running on? Windows? Linux? Mac?
Windows 7 Pro
Are you running on a CI Server? If so, which one?
No
How Did You Get This To Happen? (Steps to Reproduce)
./build.ps1
, ignore the timing of this build, it is downloading things for the first time etc.Measure-Command { ./build.ps1 -Verbosity Verbose -Verbose | Out-Host }
The end of the build output is:
You can see that Cake reported 13.8s total time. But powershell reported 38.4s total time. A difference of almost 25s. Almost all of which comes during the startup of cake. Repeated runs show similar results.
Your development machine may be faster reducing the pain, but it still shouldn't be 64% of the total time.
The text was updated successfully, but these errors were encountered: