Dynamic libraries by default and GHC 7.8
Ian Lynagh
ian at well-typed.com
Wed Nov 28 00:48:03 CET 2012
On Tue, Nov 27, 2012 at 01:34:59PM -0800, Evan Laforge wrote:
> I don't totally understand how ghci loading would work. I assume that
> for external packages it will go load x.so instead of x.a, but what
> about local modules? I assume ghc -c is still going to produce .o
> files, so does that mean ghci will have to interpret all local moules?
No, it links them into a temporary .so in /tmp and dlopens that.
> On the plus side, it seems like this would do wonders for link time,
> which is currently about 15s of "machine grinds to a halt" for me. I
> didn't see mention of it on the page, but I assume linking a binary
> with lots of giant packages is going to be a lot faster if they can be
> loaded on demand at runtime... or is just going to make startup really
> slow?
It looks like it's fractionally slower on x86_64/Linux:
Using static libraries with ghci:
$ time echo GHC.maxPrecedence | ghc --interactive -package ghc -v0
9
1.00s user 0.12s system 100% cpu 1.122 total
Using dynamic libraries with ghci:
$ time echo GHC.maxPrecedence | ghc --interactive -package ghc -v0
9
1.01s user 0.15s system 101% cpu 1.141 total
Thanks
Ian
More information about the Glasgow-haskell-users
mailing list