Bit Stream Benchmarks

Implementing Bit Stream Manipulating Programs in Many languages

five11

Description

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.


Example:

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

File:

 2:16,5:5,1:11,2:11,3:11,4:11,5:11,0:4,3:5,0:11,128:11,512:11,0:2

Result:

 [[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