Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#546 object code blow up by minor source code change

6.4.1
open
nobody
Compiler (190)
5
2005-12-01
2005-12-01
C Maeder
No

If you unpack the archive and compile the files with
optimization by:

time ghc -no-recomp --make -O HasCASL/hacapa.hs

This takes about 5 minutes and generates an unstripped
binary of 4MB.

Apply the (little) patch for HugesPJ.hs -- the one I've
sent before and that is included as "patch" in the
top-level directory. Our (slightly modified) copy of
HughesPJ.hs is Common/Lib/Pretty.hs:

patch -p0 Common/Lib/Pretty.hs patch

Now compilation takes 7 minutes and the binary gets
size 6 MB. Particularly the file HasCASL/PrintLe.o has
grown from 90 KB to 2 MB. (Compiling HasCASL/PrintLe.hs
takes visibly longer, too)

(Patching can be reversed by:
patch -p0 -R Common/Lib/Pretty.hs patch
)

This blow-up of object code caused a link failure on
our mac for a final (stripped) binary that should have
a size of around 36 MB.

(The link failure on macs is another issue that may
need attention in the future.)

The data below is obtained with ghc-6.4.1 under linux.

Cheers Christian

maeder@turing:~/haskell/examples> uname -a
Linux turing 2.6.11.4-21.9-default #1 Fri Aug 19
11:58:59 UTC 2005 i686 i686 i386 GNU/Linux
maeder@turing:~/haskell/examples> ghc --version
The Glorious Glasgow Haskell Compilation System,
version 6.4.1
maeder@turing:~/haskell/examples> gcc --version
gcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux)
Copyright (C) 2003 Free Software Foundation, Inc.
[...]
maeder@turing:~/haskell/examples> time ghc -no-recomp
--make -O HasCASL/hacapa.hs
Chasing modules from: HasCASL/hacapa.hs
Compiling Common.Lib.State ( ./Common/Lib/State.hs,
./Common/Lib/State.o )
[...]
Compiling Main ( HasCASL/hacapa.hs,
HasCASL/hacapa.o )
Linking ...

real 6m0.739s
user 5m42.199s
sys 0m9.590s
maeder@turing:~/haskell/examples> ll a.out
HasCASL/PrintLe.o
-rwxr-xr-x 1 maeder wimi 4674747 2005-12-01 14:17 a.out
-rw-r--r-- 1 maeder wimi 90308 2005-12-01 14:14
HasCASL/PrintLe.o
maeder@turing:~/haskell/examples> patch -p0
Common/Lib/Pretty.hs patch
patching file Common/Lib/Pretty.hs
Hunk #1 succeeded at 564 (offset -42 lines).
Hunk #2 succeeded at 609 (offset -42 lines).
maeder@turing:~/haskell/examples> time ghc -no-recomp
--make -O HasCASL/hacapa.hs
Chasing modules from: HasCASL/hacapa.hs
Compiling Common.Lib.State ( ./Common/Lib/State.hs,
./Common/Lib/State.o )
[...]
Compiling Main ( HasCASL/hacapa.hs,
HasCASL/hacapa.o )
Linking ...

real 8m7.962s
user 7m46.492s
sys 0m12.345s
maeder@turing:~/haskell/examples> ll a.out
HasCASL/PrintLe.o
-rwxr-xr-x 1 maeder wimi 6470827 2005-12-01 14:42 a.out
-rw-r--r-- 1 maeder wimi 2007272 2005-12-01 14:40
HasCASL/PrintLe.o

Discussion

  • C Maeder
    C Maeder
    2005-12-01

    Archive with source files and HughesPJ-patch

     
    Attachments