[gambit-list] To single-host or not to single-host?

Alex Silva asandroq at gmail.com
Fri Nov 27 04:06:44 EST 2015


Hallo,

I just grabbed Gambit 4.8.2 and did a quick test to satisfy one
curiosity. First I built it with `--enable-single-host` and `-O3`:

```
10:02 $ gsi -e '(define a (time (expt 3 10000000)))(define b (time (* a
a)))'
(time (expt 3 10000000))
    160 ms real time
    160 ms cpu time (159 user, 2 system)
    8 collections accounting for 1 ms real time (1 user, 0 system)
    71797880 bytes allocated
    7723 minor faults
    no major faults
(time (* a a))
    169 ms real time
    169 ms cpu time (161 user, 8 system)
    2 collections accounting for 0 ms real time (0 user, 0 system)
    71153680 bytes allocated
    2037 minor faults
    no major faults
```

Then I built it again without `--enable-single-host`, but used GCC's
link-time optimization[1]:

```
10:03 $ ./gsi/gsi -e '(define a (time (expt 3 10000000)))(define b (time
(* a a)))'
(time (expt 3 10000000))
    148 ms real time
    148 ms cpu time (145 user, 3 system)
    8 collections accounting for 2 ms real time (0 user, 0 system)
    71797880 bytes allocated
    7696 minor faults
    no major faults
(time (* a a))
    156 ms real time
    155 ms cpu time (148 user, 8 system)
    2 collections accounting for 0 ms real time (1 user, 0 system)
    71153680 bytes allocated
    2037 minor faults
    no major faults
```

It seems that LTO can give betters results than the single-host mode
because the `-O3` flag is honoured by GCC.

[1] https://gcc.gnu.org/wiki/LinkTimeOptimization

Cheers,
-alex



More information about the Gambit-list mailing list