#2089: reading the package db is slow
---------------------------------------------+------------------------------
    Reporter:  duncan                        |       Owner:          
        Type:  compile-time performance bug  |      Status:  new     
    Priority:  normal                        |   Component:  Driver  
     Version:  6.8.2                         |    Severity:  minor   
    Keywords:                                |    Testcase:          
Architecture:  x86_64 (amd64)                |          Os:  Multiple
---------------------------------------------+------------------------------
 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.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2089>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to