[GHC] #11285: Split objects makes static linking really slow

GHC ghc-devs at haskell.org
Fri Dec 25 04:16:18 UTC 2015


#11285: Split objects makes static linking really slow
-------------------------------------+-------------------------------------
        Reporter:  ezyang            |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  high              |            Milestone:
       Component:  Compiler          |              Version:  7.11
  (Linking)                          |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Compile-time      |  Unknown/Multiple
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by ezyang):

 Ha! On a quick and dirty test, `-ffunction-sections` is FOUR times worse
 for compiling `Setup.hs` on `ld.bfd`. However, it is TWO times better with
 `ld.gold`. (But not using split objects with gold is still the fastest.)

 {{{
 [ezyang at hs01 ezyang]$ rm Setup; time ghc-8.0-nosplitobjs/inplace/bin/ghc-
 stage2 -no-user-package-db --make Setup.hs -O0 -optl-fuse-ld=gold
 [1 of 1] Compiling Main             ( Setup.hs, Setup.o )
 Linking Setup ...

 real    0m1.429s
 user    0m1.250s
 sys     0m0.163s
 sys     0m0.583s
 [ezyang at hs01 ezyang]$ rm Setup; time ghc-8.0/usr/bin/ghc -no-user-package-
 db --make Setup.hs -O0 -optl-fuse-ld=gold
 Linking Setup ...

 real    0m2.537s
 user    0m2.310s
 sys     0m0.220s
 [ezyang at hs01 ezyang]$ rm Setup; time ghc-8.0-nosplitobjs/inplace/bin/ghc-
 stage2 -no-user-package-db --make Setup.hs -O0
 Linking Setup ...

 real    0m11.349s
 user    0m10.823s
 sys     0m0.553s
 [ezyang at hs01 ezyang]$ rm Setup; time ghc-8.0/usr/bin/ghc -no-user-package-
 db --make Setup.hs -O0
 [1 of 1] Compiling Main             ( Setup.hs, Setup.o )
 Linking Setup ...

 real    0m3.380s
 user    0m2.867s
 sys     0m0.500s
 }}}

 I don't think we can generally assume people will be using gold, so
 switching this on by default probably is unacceptable.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/11285#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list