Ticket #2089 (closed bug: fixed)
reading the package db is slow
|Reported by:||duncan||Owned by:|
|Operating System:||Unknown/Multiple||Architecture:||x86_64 (amd64)|
|Type of failure:||Compile-time performance bug||Difficulty:||Moderate (less than a day)|
|Test Case:||Blocked By:|
With a large number of registered packages it takes ages for ghc to read the package db and it does this every time it is run so it starts to add up.
I have a rather fast x86-64 machine and 160 registered packages. Here are some timings:
$ time ghc-pkg list > /dev/null user 0m1.164s $ time ghc -c does-not-exist.c 2> /dev/null real 0m0.612s $ time hsc2hs does-exist.hsc --cflag=--version 2> /dev/null user 0m0.572s
So since cabal configure involves running all of the above it starts to take a while:
$ time cabal configure Configuring cabal-install-0.4.3... real 0m2.241s user 0m1.916s
The obvious solution is to use a binary cache of the package db containing the most commonly needed mappings like module name -> package etc.