Bit Stream Benchmarks

Implementing Bit Stream Manipulating Programs in Many languages



The five11 benchmark takes a file as input. The file contains a number of IS-683 PRL packets. The first 16 bits contain an integer describing how many packets are in the file. Each packet has the following layout:

----------------------------------------------------------             ------------------------------------------------
| N (5 bits) | Channel 1 (11 bits) | Channel 2 (11 bits) |.............| Channel N (11 bits) | Pad (to byte boundary) |
-- -------------------------------------------------------             ------------------------------------------------

The task in this benchmark is to create a list of all the channels in a packet for all packets. To make sure this is done, calculate the sum of all channels and write that to a file.


The syntax to describe the file works as follows: a:b means the following b bits have the value a




 [[1,2,3,4,5],[0,128,512]],  sum = 655

Time Measurement

The time for this benchmark should be started when the file has been read into memory until the sum has been generated. Functional languages are not allowed to use destructive updates or preallocated buffers in the time-sensitive part.

Iterations: 10000

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.five11 and testdata.five11.out