| 1 |
-- Intro |
| 2 |
|
| 3 |
Some people have expressed opinions about how |
| 4 |
fast libb64's encoding and decoding routines |
| 5 |
are, as compared to some other BASE64 packages |
| 6 |
out there. |
| 7 |
|
| 8 |
This document shows the result of a short and sweet |
| 9 |
benchmark, which takes a large-ish file and |
| 10 |
encodes/decodes it a number of times. |
| 11 |
The winner is the executable that does this task the quickest. |
| 12 |
|
| 13 |
-- Platform |
| 14 |
|
| 15 |
The tests were all run on a Fujitsu-Siemens laptop, |
| 16 |
with a Pentium M processor running at 2GHz, with |
| 17 |
1GB of RAM, running Ubuntu 10.4. |
| 18 |
|
| 19 |
-- Packages |
| 20 |
|
| 21 |
The following BASE64 packages were used in this benchmark: |
| 22 |
|
| 23 |
- libb64-1.2 (libb64-base64) |
| 24 |
From libb64.sourceforge.net |
| 25 |
Size of executable: 18808 bytes |
| 26 |
Compiled with: |
| 27 |
CFLAGS += -O3 |
| 28 |
BUFFERSIZE = 16777216 |
| 29 |
|
| 30 |
- base64-1.5 (fourmilab-base64) |
| 31 |
From http://www.fourmilab.ch/webtools/base64/ |
| 32 |
Size of executable: 20261 bytes |
| 33 |
Compiled with Default package settings |
| 34 |
|
| 35 |
- coreutils 7.4-2ubuntu2 (coreutils-base64) |
| 36 |
From http://www.gnu.org/software/coreutils/ |
| 37 |
Size of executable: 38488 bytes |
| 38 |
Default binary distributed with Ubuntu 10.4 |
| 39 |
|
| 40 |
-- Input File |
| 41 |
|
| 42 |
Using blender-2.49b-linux-glibc236-py25-i386.tar.bz2 |
| 43 |
from http://www.blender.org/download/get-blender/ |
| 44 |
Size: 18285329 bytes |
| 45 |
(approx. 18MB) |
| 46 |
|
| 47 |
-- Method |
| 48 |
|
| 49 |
Encode and Decode the Input file 50 times in a loop, |
| 50 |
using a simple shell script, and get the running time. |
| 51 |
|
| 52 |
-- Results |
| 53 |
|
| 54 |
$ time ./benchmark-libb64.sh |
| 55 |
real 0m28.389s |
| 56 |
user 0m14.077s |
| 57 |
sys 0m12.309s |
| 58 |
|
| 59 |
$ time ./benchmark-fourmilab.sh |
| 60 |
real 1m43.160s |
| 61 |
user 1m23.769s |
| 62 |
sys 0m8.737s |
| 63 |
|
| 64 |
$ time ./benchmark-coreutils.sh |
| 65 |
real 0m36.288s |
| 66 |
user 0m24.746s |
| 67 |
sys 0m8.181s |
| 68 |
|
| 69 |
28.389 for 18MB * 50 |
| 70 |
= 28.389 for 900 |
| 71 |
|
| 72 |
-- Conclusion |
| 73 |
|
| 74 |
libb64 is the fastest encoder/decoder, and |
| 75 |
has the smallest executable size. |
| 76 |
|
| 77 |
On average it will encode and decode at roughly 31.7MB/second. |
| 78 |
|
| 79 |
The closest "competitor" is base64 from GNU coreutils, which |
| 80 |
reaches only 24.8MB/second. |
| 81 |
|
| 82 |
-- |
| 83 |
14/06/2010 |
| 84 |
[email protected] |
| 85 |
|