-
Notifications
You must be signed in to change notification settings - Fork 848
Poor performance when building many packages #2831
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
Comments
I looked into this a little more this morning. I discovered that, perhaps obviously, this isn't a problem with Stack per se. I did a
In other words,
I think that improving the performance of building packages will require hacking on Cabal. |
I wrote a benchmark for this behavior using Cabal. The takeaway is that building a package with a cold cache takes about 1.5 seconds. With a warm cache it's about 0.5 seconds. Since this is a problem with Cabal, I opened an issue there: haskell/cabal#4175. |
I was curious about the relative performance of lots of declarations vs. modules vs. packages. I wrote a benchmark that creates a Stack project with some number of those things and times how long it takes to build. The raw results from 1 to 64 are available in this Google doc. Here they are graphed:
As you can see, adding declarations or modules does not significantly increase the build time. However, the build time is linearly correlated to the number of packages. I expected this to a certain extent because packages do a lot more than modules or declarations. I didn't expect each package to add 0.6 seconds to the build time, though.
I know this isn't a problem per se, but it's unfortunate that building 10 packages incurs a 6 second performance penalty. I don't have any insight into why Stack takes that long. Is this worth exploring, or is this just the price that must be paid to compile a Haskell package?
For this benchmark the declarations, modules, and packages are as simple as possible. Here's what a module would look like:
And here's a package definition:
And here's the Stack config:
The text was updated successfully, but these errors were encountered: