On Saturday, September 8, 2018 at 12:56:57 AM UTC-4, Robert L. wrote:
> So Chicken is 3.43 as fast as Gambit.
Benchmarking is hard, I appreciate the effort that ecraven puts into it here:
https://ecraven.github.io/r7rs-benchmarks/
where he reports the following benchmark times on his machine:
cat: chicken-4.13.0 (13.79), gambitc-v4.8.9 (17.25)
string: chicken-4.13.0 (.17), gambitc-v4.8.9 (.57)
So if you're *really* interested in the "string" program, Chicken is 3.35 times as fast as Gambit.
But you recommended above:
;; Compile with:
;; csc -O5 count-change.scm
The Chicken manual says
-optimize-level 5
is equivalent to
-optimize-leaf-routines -block -inline -inline-global -specialize -unsafe -disable-interrupts -no-trace -no-lambda-info -clustering -lfa2
I'm no Chicken expert, but the documentation here:
http://wiki.call-cc.org/man/4/Declarations
leads me to believe that some of these compiler options are equivalent to the Gambit declarations
(declare (standard-bindings)
(extended-bindings)
(block)
(not safe)
(not interrupts-enabled))
and if I add these to the top of count-change.scm I get
firefly:~> csc -O5 count-change.scm
firefly:~> ./count-change
801451
0.58s CPU time, maximum live heap: 236.21 KiB
firefly:~> gsc -exe count-change.scm
firefly:~> ./count-change
801451
(time (begin (display (count-change 1000)) (newline)))
0.507591 secs real time
0.507598 secs cpu time (0.507598 user, 0.000000 system)
no collections
272 bytes allocated
7 minor faults
no major faults
This is with
firefly:~> csi -version
CHICKEN
(c) 2008-2017, The CHICKEN Team
(c) 2000-2007, Felix L. Winkelmann
Version 4.13.0 (rev 68eeaaef)
linux-unix-gnu-x86-64 [ 64bit manyargs dload ptables ]
compiled 2017-12-11 on
yves.more-magic.net (Linux)
firefly:~> gsi -v
v4.9.0 20170203122653 x86_64-unknown-linux-gnu "./configure 'CC=gcc -march=native -D___CAN_IMPORT_CLIB_DYNAMICALLY' '--enable-single-host' '--enable-shared' '--enable-multiple-versions'"
So I would say that Chicken and Gambit are about the same speed for small programs that use unsafe fixnum arithmetic, unsafely.
Brad