Next: , Previous: Performance of Compiled Code, Up: Performance of Compiled Code


4.1 Gain in Speed

The author has so far compiled and tested a number of large programs (theorem provers for various logics and hobbit itself).

The speedup for the provers was between 25 and 40 times for various provable formulas. Comparison was made between the provers being interpreted and compiled with ‘gcc -O2 -DRECKLESS’ on Sparcstation ELC in both cases.

The provers were written with care to make the compiled version run fast. They do not perform excessive consing and they perform very little arithmetic.

According to experiments made by A. Jaffer, the compiled form of the example program pi.scm was approximately 11 times faster than the interpreted form.

As a comparison, his hand-coded C program for the same algorithm of computing pi was about 12 times faster than the interpreted form. pi.scm spends most of of its time in immediate arithmetics, vector-ref and vector-set!.

P. Kelloma"ki has reported a 20-fold speedup for his generic scheme debugger. T. Moore has reported a 16-fold speedup for a large gate-level IC optimizer.

Self-compilation speeds Hobbit up only ca 10 times.

However, there are examples where the code compiled by hobbit runs actually slower than the same code running under interpreter: this may happen in case the speed of the code relies on non-liftable closures and proper mutual tailrecursion. See for example the closure-intensive benchmark CPSTAK in the following table.