Skip to content

Big package databases make GHC slow to start up #4093

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

Open
ezyang opened this issue Nov 8, 2016 · 1 comment
Open

Big package databases make GHC slow to start up #4093

ezyang opened this issue Nov 8, 2016 · 1 comment

Comments

@ezyang
Copy link
Contributor

ezyang commented Nov 8, 2016

ezyang@sabre:~$ time ghc -no-global-package-db -e "return ()" 

<interactive>:1:1:
    Failed to load interface for ‘Prelude’
    Use -v to see a list of the files searched for.

real	0m0.100s
user	0m0.080s
sys	0m0.016s
ezyang@sabre:~$ time ghc  -e "return ()" 

real	0m0.230s
user	0m0.176s
sys	0m0.052s
ezyang@sabre:~$ time ghc -package-db .cabal/store/ghc-7.10.3/package.db/ -e "return ()" 

real	0m0.310s
user	0m0.268s
sys	0m0.036s

That's a 3x difference for no discernible benefit at all! And it gets worse as the package database size increases. Maybe we should populate the plan database with exactly the packages involved in our plan.

@hvr
Copy link
Member

hvr commented Nov 9, 2016

Fwiw, we will also need to figure out a way to make ghc-pkg register not become a bottleneck for big nix-stores (at least for future GHC versions, if we can't help existing GHCs). I'll soon run into the situation where I'll have several thousands of packages in a huge nix-store, and there ghc-pkg will incur a significant overhead when cabal registers a new package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants