In the trunk, I eliminated the linking of the functions inside simpsim.c to
the .so file when FCS_FREECELL_ONLY is specified. It can be made more
configurable, but it is still pretty good and seems to work. Strangely enough,
benchmarking it now yielded a somewhat smaller speed than the latest
benchmark.
In any case, I wanted to measure the Freecell Solver shared library
("libfreecell-solver.so*") in the different configurations to see how big it
is. So I wrote a Ruby script to measure it in the different configurations and
prepare a report. Here is the report:
{{{{{{{{{
default - before strip - 261266
default - after strip - 118172
release - before strip - 120755
release - after strip - 107420
r-fc-only - before strip - 101283
r-fc-only - after strip - 88680
[ That's report - freecell only. ]
r-fc-only-arch-omit-frame - before strip - 102349
r-fc-only-arch-omit-frame - after strip - 89736
[ Release, Freecell Only, with -march=pentium4 and -fomit-frame-pointer ]
r-fc-only-omit-frame - before strip - 105379
r-fc-only-omit-frame - after strip - 92776
[ Release, FC Only, with -fomit-frame--pointer (and no -march) ]
gcc-Os - before strip - 89711
gcc-Os - after strip - 76680
[ Release, with -Os (optimise for size), and generic (no FC Only) ]
gcc-Os-fc-only - before strip - 78303
gcc-Os-fc-only - after strip - 66020
[ Release, with -Os and Freecell Only ]
}}}}}}}}}}}}
So we're down to 66,020 bytes for the fc-only and 76,680 for the generic
version. Although the other results are not bad either. For comparison, Gary
Campbell's FCELL.COM which is written in 8088 Assembly for DOS is 13,641
bytes. So this makes Freecell Solver about 4.8 to 5.6 bigger than it, which is
acceptable for a 32-bit program written in C.
The code and binary size may still be reduced further by using refactoring and
other cleanups, but I don't think they are too big.
Regards,
Shlomi Fish
P.S: now after I moved lookup2.{c,h} to the rejects and am no longer compiling
it, the gcc-Os-Fc-only after strip is only 65,908 bytes long. That's even
(slightly) better.
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Optimizing Code for Speed - http://xrl.us/begfgk
God gave us two eyes and ten fingers so we will type five times as much as we
read.
Received on Mon May 18 2009 - 09:24:12 IDT