« Reading List: The Politically Incorrect Guide to American History | Main | Tom Swift and His Sky Racer Now Online »

Wednesday, September 14, 2005

Floating Point Benchmark: Common Lisp Benchmark Added

I have just posted a Common Lisp implementation of the floating point benchmark (the original trigonometry-intense fbench, not the FFT-based ffbench) and added results from GNU Common Lisp 2.6.7 in both compiled and interpreted modes to the language performance comparison section of the fbench document. Here is the updated relative performance table.

Language Relative
C 1 GCC 3.2.3 -O3, Linux
Visual Basic .NET 0.866 All optimisations, Windows XP
FORTRAN 1.008 GNU Fortran (g77) 3.2.3 -O3, Linux
Java 1.121 Sun JDK 1.5.0_04-b05, Linux
Visual Basic 6 1.132 All optimisations, Windows XP
Ada 1.401 GNAT/GCC 3.4.4 -O3, Linux
Lisp 7.41
GNU Common Lisp 2.6.7, Compiled, Linux
GNU Common Lisp 2.6.7, Interpreted
Python 17.6 Python 2.3.3 -OO, Linux
Perl 23.6 Perl v5.8.0, Linux
JavaScript 27.6
Opera 8.0, Linux
Internet Explorer 6.0.2900, Windows XP
Mozilla Firefox 1.0.6, Linux
QBasic 148.3 MS-DOS QBasic 1.1, Windows XP Console

The Common Lisp benchmark is a straightforward translation of the reference C implementation; while I have tried to replace C idioms with those of Lisp, I have not attempted higher level restructuring, which I would consider to exceed the mandate of the benchmark, a straightforward computer implementation of a computation originally done manually with tables of logarithms and trigonometric functions. Common Lisp provides a variety of advisory declarations intended to assist compiler optimisation. For example, one can declare that a variable always takes on floating point values so compiled code doesn't have to worry about your assigning a list to it. This program is written in "Classic Lisp" and uses none of these declarations (which had no measurable effect in my very limited experiments with GNU Common Lisp). Lisp experts and those interested in evaluating other Lisp compilers may wish to add declarations where appropriate.

Posted at September 14, 2005 15:45