Bit Stream BenchmarksImplementing Bit Stream Manipulating Programs in Many languages uudecodeDescriptionThis benchmark implements the uudecode program which is used to transport binary files across networks which only can transfer a subset of all bytecodes reliably. Therefore each 6-bit block in the binary file is translated into a byte value in the range 32-95. The format of the encoded file is as follows:
Where X is the number of encoded octets in each line + 32. The last line before end only contains a space. Typically the number of encoded octets in a line is 45. To decode a line, take each 4 byte group (b1,b2,b3,b4) and create a 3 byte group by doing:
If the number of encoded bytes in a line is not evenly divisible by three just scrap the unneeded bytes from the last four-byte group. To decode the file, decode each line until you find a line starting with space (ASCII 32) then check that the next line starts with end. Example:Input:
Output:
Time MeasurementThe time for this benchmark should be taken from when the file has been loaded and until the decoded string has been created. Iterations: 100Source CodeThis benchmark has been implemented in the following languages:
Example input and output:testdata.uudecode and testdata.uudecode.out last updated 2 years ago # |