-
Notifications
You must be signed in to change notification settings - Fork 843
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
'No op' stack build
is slower for Stack 2.13.1 than Stack 2.7.5
#6553
Comments
Experimenting (on Windows 11) with a simple multi-package project mkdir noOpTest
cd noOpTest
1..80 | % { stack new package$_ --no-init}
stack init Testing with: stack purge
stack build
Measure-Command {stack build | Out-Default} # 'no op' stack build, applied repeatedly
After the first 'no op' |
With Stack 2.7.5, for a number of packages (but not all) The same is true for the current version of Stack. |
Controlling for Hpack, I deleted
So, it looks like it is Hpack's involvement that is slowing down the first 'no op' run of the current version of Stack. Stack 2.7.5 comes with Hpack 0.34.4. The current version of Stack comes with Hpack 0.36.0. (Stack 2.9.1 comes with Hpack 0.35.0.) |
Controlling for Hpack (no
|
Controlling for Hpack (
|
Not controlling for Hpack, controlling for GHC (as above) but using Cabal files initialised with the native version of Hpack in each case (ie Hpack 0.34.4 for Stack 2.7.5; Hpack 0.36.0 for the current version of Stack):
It appears to me that the #6553 (comment) comparison was likely an effect of some conflict between automatically-generated Cabal files and the built-in version of Hpack. |
Btw, I'm pretty sure that the slowness in master is again in the build plan step. Mostly, I think it's traversing the full dependency graph unnecessarily, just a hunch. Maybe 2.7.5 wasn't doing what it needed to be doing, but the debug log on 2.13.1 (and latest master) looks like it's spending time in the build plan, where the 2.7.5 looks really fast. It just slams through the build plan faster than master does now. Though, again, maybe 2.7.5 wasn't doing what it needed to do or there's slowness upstream in Cabal, as you suggested. However, the build plan might be a good place to narrow in on. |
@wraithm, the problem I have - at #6553 (comment) - is I can't reproduce the issue on Windows 11 with a 80-package project: like-for-like, the current version of Stack is faster than Stack 2.7.5. |
Do those packages have external and internal (within the project, between those packages) dependencies? |
@wraithm, I take your point. I'll see if I can create an example multi-package project where package n depends on package n-1 for n > 1. |
Can I just say this is astonishing work — so much appreciate it! Performance of the tools is so important and it really marvelous to see this kind of care being taken. (Indeed, there seems to be much work across the Haskell tool chain recently.) |
So, I created https://github.com/mpilgrem/mkMultiPkgTest to create an executable ( module Lib3
( someFunc3
) where
import Lib1
import Lib2
someFunc3 :: IO ()
someFunc3 = do
putStrLn "someFunc3"
someFunc1
someFunc2 I also exited things on my Windows 11 system that might otherwise distract the CPUs. (EDIT: I had not taken that step before - although I think my system was broadly stable between different runs previously.) I created two projects:
So, even with these more complex projects, I can't recreate Stack 2.7.5 being faster than the most current version of Stack. |
@cdornan, the credit goes to @wraithm, who noticed the original regression, reported it, and tracked down the commit at #6551 (comment). |
Very interesting! Thank you for your research. I'll do some digging and see if I can analyze what's slowing down The next thing I'd look at is having lots of external deps. |
Thank you for fixing it and your hard work maintaining |
I previously did some work to improve the speed after it became much slower when GHC started listening more dependent files. In my case i had to have template haskell in the project for it to be an significant issue |
Motivation: #6551
For a mult-package project (80+ packages) Stack 2.7.5 reportedly takes ~ 2 s for a 'no op'
stack build
while Stack 2.13.1 (and, now, post #6552 Stack) reportedly takes ~ 7 s to 8 s.Can the Stack 2.7.5 level of performance be regained?
However, worth recognising that Stack 2.7.5 had a dependency on
Cabal-3.2.1.0
(LTS 17.15) and modern Stack, currently, has a dependency onCabal-3.10.1.0
(LTS 22.7). It is not inconceivable that something may have happened upstream.EDIT: I am wondering if the effect is real, as I can not reproduce it in my experiments at #6553 (comment) or (EDIT2) #6553 (comment).
The text was updated successfully, but these errors were encountered: