Bit Stream BenchmarksImplementing Bit Stream Manipulating Programs in Many languages This is a website which describes benchmarks that each entail operations on bit streams. So far there are five different benchmarks: These benchmarks have all been implemented in Erlang, O'Caml and Haskell. They are in the process of being implemented in C and Java as well. The general rules of the game are that the functional languages are not allowed to use mutable arrays to do anything but read the input. More complete rules for benchmarking are available for each benchmark. ResultsThe table shows some preliminary results when running the benchmarks on a 2.4 GHz pentium IV with 1 GB of memory. The OS is Fedora Core 3.
The runtimes on this machine is shown in Table 1, whereas the number of lines of code necessary to implement the benchmarks is recorded in Table 2. The number of lines does not include code used to measure time or setup before the benchmark. Furthermore some lines are not counted to avoid punishing certain coding styles. Exactly which lines are counted is reflected in the source file by a comment containing a line number.
These numbers are still provisional, some of the Haskell programs can probably be improved a little bit further while remaining readable, but they have already been improved immensly by the help of some of the people at haskell-cafe, many thanks to Spencer Janssen, Chris Kuklewicz and Donald Bruce Stewart among others. Updates:drop3 and huffman written in O'Caml have been improved by removing unnecessary list-building, thanks to Xavier Leroy Compiling and runningThe O'Caml programs have been compiled using the ocamlopt compiler version 3.09.1 with the following command:
The Haskell programs have been compiled using the Glasgow Haskell Compiler version 6.4 with the following command:
The touch command is used to convince GHC to recompile from source in case it has already been compiled with different flags. The Java programs are compiled to native code using Gnu's compiler for Java with the following command:
The C programs are compiled to native code using Gnu's compiler for C with the following command:
The Erlang programs are compiled using an extended P11 compiler. The following compile command was used:
Since the Erlang compiler does not produce a standalone executable the following command is used to run the Erlang benchmark:
Since the other compilers produces executables the benchmarks can simply be run by:
Runtime measurements are taken inside the benchmarks and reported by printing a floating point number to stdout. The process of compiling and running these benchmarks was automated using this Erlang program Running benchmarks on you own machine
QuestionsIf you have any questions about this project please contact Per Gustafsson last updated 2 years ago # |