Bit Stream Benchmarks

Implementing Bit Stream Manipulating Programs in Many languages



The drop3 benchmark takes a file as input. The file consists of a sequence of three bit groups. The drop3 program creates the sequence which consists of all of the bit triples from the original sequence that start with a 1. It also keeps track of how many bits there are in the generated sequence.

If the number of bits in the file is not evenly divisible by three, the last 1 or 2 bits should be skipped. In order to check correctness the generated sequence can be printed to a file dropping the bit-triples that do not form entire bytes.


Original bit sequence: 010 000 100 111 011 110 100 001 010 011 10 = (66 119 161 78)

Resulting bit sequence: 100 111 110 100

Droping the bits that do not form an entire byte: 10011111 = (159)

Time Measurement

To avoid measuring I/O, we measure time from the point when the original sequence has been read into memory until the time the resulting sequence has been generated. Functional languages are not allowed to use destructive updates or preallocated buffers in the time-sensitive part.

Iterations: 10

Source Code

This benchmark has been implemented in the following languages:

  1. C:
  2. Erlang:
  3. Haskell:
  4. Java:
  5. O'Caml:

Example input and output:

testdata.drop3 and testdata.drop3.out