Extended Results

January 12, 2016 · View on GitHub

This contains the extended benchmarking results. All data formats and libraries supported by the benchmark are included here, and several configurations are provided for some libraries. For example ordered/unordered for Jansson, normal/in-situ for RapidJSON, unoptimized/type-optimized for ubj, etc.

Standard deviation is shown for the remaining five iterations after dropping highest and lowest of seven total iterations. Standard deviation is correctly propagated in hash subtraction and overhead calculation.

Speed - Desktop PC

These results are for a speed-optimized build (-O3 -flto) on a typical, somewhat outdated desktop PC. The tests are run on Arch Linux in recovery mode.

CPU model: AMD Phenom(tm) II X6 1090T Processor
Bogomips: 6402.44 Tue Jan 12 03:04:08 EST 2016

Small Data

Hash Comparisons

BenchmarkTime
(μs)
Code Size
(bytes)
Comparison
hash-data.c2.26 ± 0.0919336subtracted from Write tests
hash-object.c3.61 ± 0.0120016subtracted from Tree and Incremental tests

The Time column shows the total time taken to hash the expected output of the library in the test (the expected objects for Tree and Incremental tests, or a chunk of bytes roughly the size of encoded data for the Write tests.) The Code Size column shows the total code size of the benchmark harness, including object generation code (which is included in all tests.)

Write Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack2.13 ± 0.0940881.94 ± 0.081a9c6681
msgpack C++ (1.3.0) (C++)MessagePack2.77 ± 0.0986162.22 ± 0.091a9c6681
MPack (0.8.1) [tracking] (C)MessagePack4.89 ± 0.0953683.16 ± 0.131a9c6681
msgpack C (1.3.0) (C)MessagePack6.42 ± 0.1140883.83 ± 0.151a9c6681
CMP (v14) (C)MessagePack7.33 ± 0.1032324.24 ± 0.171a9c6681
MongoDB Legacy (1.1.0) (C++)BSON10.21 ± 0.101809525.51 ± 0.224e02a1f9
ubj (f4d85c4) (C)UBJSON10.41 ± 0.0933525.60 ± 0.22c1a19bb7
RapidJSON (1.0.2) (C++)JSON12.26 ± 0.09169046.41 ± 0.25e4495ccf
ubj (f4d85c4) [optimized] (C)UBJSON13.59 ± 0.0941847.00 ± 0.2837f97981
libbson (1.3.0) (C)BSON14.47 ± 0.11211127.39 ± 0.294e02a1f9
Binn (b3e2c27) (C)Binn17.48 ± 0.2382168.72 ± 0.36d7327409
YAJL (2.1.0) (C)JSON37.86 ± 0.29675217.72 ± 0.714694ca58
json-builder (19c739f) (C)JSON51.64 ± 1.90456023.80 ± 1.2675d4861f
Jansson (2.7) (C)JSON63.40 ± 2.111252828.99 ± 1.48586d4446
Jansson (2.7) [ordered] (C)JSON74.04 ± 2.831270433.69 ± 1.8397b6e2b2

The Time and Code Size columns show the net result after subtracting the hash-data time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-data. In all three columns, lower is better.

Tree Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
libbson (1.3.0) (C)BSON4.45 ± 0.0134962.23 ± 0.000075ff81
MPack (0.8.1) (C)MessagePack4.99 ± 0.0156242.38 ± 0.000075ff81
MongoDB Legacy (1.1.0) (C++)BSON5.99 ± 0.041802802.66 ± 0.010075ff81
msgpack C (1.3.0) (C)MessagePack6.47 ± 0.0352002.79 ± 0.010075ff81
Binn (b3e2c27) (C)Binn7.60 ± 0.0249443.11 ± 0.010075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack8.44 ± 0.0162003.34 ± 0.010075ff81
msgpack C++ (1.3.0) (C++)MessagePack9.40 ± 0.03191523.60 ± 0.010075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON10.58 ± 0.03146003.93 ± 0.010075ff81
RapidJSON (1.0.2) (C++)JSON15.18 ± 0.05158005.20 ± 0.020075ff81
ubj (f4d85c4) [optimized] (C)UBJSON45.62 ± 1.311007213.63 ± 0.360075ff81
ubj (f4d85c4) (C)UBJSON51.78 ± 0.951007215.34 ± 0.260075ff81
json-parser (7053321) (C)JSON67.89 ± 1.73828819.80 ± 0.480075ff81
YAJL (2.1.0) (C)JSON99.31 ± 3.102259228.50 ± 0.860075ff81
Jansson (2.7) (C)JSON105.18 ± 1.391444030.12 ± 0.3938b31ddb
Jansson (2.7) [ordered] (C)JSON109.69 ± 2.631479231.37 ± 0.730075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Incremental Parse Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack3.20 ± 0.0153361.89 ± 0.000075ff81
libbson (1.3.0) (C)BSON4.45 ± 0.0134962.23 ± 0.000075ff81
MPack (0.8.1) [tracking] (C)MessagePack5.10 ± 0.0275522.41 ± 0.010075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON5.57 ± 0.0265042.54 ± 0.010075ff81
MongoDB Legacy (1.1.0) (C++)BSON5.99 ± 0.041802802.66 ± 0.010075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack6.53 ± 0.0254642.81 ± 0.010075ff81
CMP (v14) (C)MessagePack7.43 ± 0.0634403.06 ± 0.020075ff81
Binn (b3e2c27) (C)Binn7.60 ± 0.0249443.11 ± 0.010075ff81
RapidJSON (1.0.2) (C++)JSON9.70 ± 0.0286883.68 ± 0.010075ff81
YAJL (2.1.0) (C)JSON19.86 ± 0.06125126.50 ± 0.020075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Large Data

Hash Comparisons

BenchmarkTime
(μs)
Code Size
(bytes)
Comparison
hash-data.c144.28 ± 9.1719336subtracted from Write tests
hash-object.c353.45 ± 1.5220016subtracted from Tree and Incremental tests

The Time column shows the total time taken to hash the expected output of the library in the test (the expected objects for Tree and Incremental tests, or a chunk of bytes roughly the size of encoded data for the Write tests.) The Code Size column shows the total code size of the benchmark harness, including object generation code (which is included in all tests.)

Write Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack307.27 ± 9.2040883.13 ± 0.20b4ac134d
msgpack C++ (1.3.0) (C++)MessagePack347.14 ± 9.2486163.41 ± 0.22b4ac134d
MPack (0.8.1) [tracking] (C)MessagePack475.85 ± 9.2253684.30 ± 0.27b4ac134d
msgpack C (1.3.0) (C)MessagePack544.24 ± 11.3240884.77 ± 0.31b4ac134d
CMP (v14) (C)MessagePack660.19 ± 11.7832325.58 ± 0.36b4ac134d
MongoDB Legacy (1.1.0) (C++)BSON715.26 ± 9.241809525.96 ± 0.3814d7b3b5
ubj (f4d85c4) (C)UBJSON881.34 ± 9.2633527.11 ± 0.4512ead223
ubj (f4d85c4) [optimized] (C)UBJSON1007.45 ± 9.2541847.98 ± 0.518f23e492
libbson (1.3.0) (C)BSON1048.95 ± 9.39211128.27 ± 0.5314d7b3b5
RapidJSON (1.0.2) (C++)JSON1097.71 ± 9.21169048.61 ± 0.55a1ab8d87
Binn (b3e2c27) (C)Binn1687.91 ± 11.73821612.70 ± 0.8107910350
YAJL (2.1.0) (C)JSON3125.41 ± 26.25675222.66 ± 1.4511ddf727
json-builder (19c739f) (C)JSON5032.13 ± 10.81456035.88 ± 2.289061166e
Jansson (2.7) (C)JSON6540.87 ± 34.641252846.33 ± 2.96436d7f85
Jansson (2.7) [ordered] (C)JSON7152.87 ± 132.341270450.58 ± 3.3403e30c6f

The Time and Code Size columns show the net result after subtracting the hash-data time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-data. In all three columns, lower is better.

Tree Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
libbson (1.3.0) (C)BSON301.90 ± 2.2034961.85 ± 0.0191b5d7ef
MPack (0.8.1) (C)MessagePack414.16 ± 2.3456242.17 ± 0.0191b5d7ef
MongoDB Legacy (1.1.0) (C++)BSON453.91 ± 4.991802802.28 ± 0.0291b5d7ef
Binn (b3e2c27) (C)Binn597.67 ± 2.9149442.69 ± 0.0191b5d7ef
msgpack C (1.3.0) (C)MessagePack750.87 ± 2.2752003.12 ± 0.0191b5d7ef
MPack (0.8.1) [UTF-8] (C)MessagePack751.61 ± 2.0462003.13 ± 0.0191b5d7ef
msgpack C++ (1.3.0) (C++)MessagePack1004.67 ± 2.95191523.84 ± 0.0291b5d7ef
RapidJSON (1.0.2) [in-situ] (C++)JSON1129.46 ± 1.84146004.20 ± 0.0291b5d7ef
RapidJSON (1.0.2) (C++)JSON1694.28 ± 2.37158005.79 ± 0.0391b5d7ef
ubj (f4d85c4) [optimized] (C)UBJSON3564.19 ± 24.681007211.08 ± 0.0891b5d7ef
ubj (f4d85c4) (C)UBJSON4340.63 ± 23.331007213.28 ± 0.0991b5d7ef
json-parser (7053321) (C)JSON6437.37 ± 31.57828819.21 ± 0.1291b5d7ef
YAJL (2.1.0) (C)JSON8236.40 ± 73.392259224.30 ± 0.2391b5d7ef
Jansson (2.7) (C)JSON9529.31 ± 36.551444027.96 ± 0.165b6ba465
Jansson (2.7) [ordered] (C)JSON9815.17 ± 28.361479228.77 ± 0.1591b5d7ef

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Incremental Parse Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack202.09 ± 2.4353361.57 ± 0.0191b5d7ef
libbson (1.3.0) (C)BSON301.90 ± 2.2034961.85 ± 0.0191b5d7ef
MPack (0.8.1) [tracking] (C)MessagePack319.70 ± 1.9075521.90 ± 0.0191b5d7ef
MongoDB Legacy (1.1.0) (C++)BSON453.91 ± 4.991802802.28 ± 0.0291b5d7ef
RapidJSON (1.0.2) [in-situ] (C++)JSON532.73 ± 2.1165042.51 ± 0.0191b5d7ef
CMP (v14) (C)MessagePack533.46 ± 3.2334402.51 ± 0.0191b5d7ef
MPack (0.8.1) [UTF-8] (C)MessagePack565.73 ± 2.3654642.60 ± 0.0191b5d7ef
Binn (b3e2c27) (C)Binn597.67 ± 2.9149442.69 ± 0.0191b5d7ef
RapidJSON (1.0.2) (C++)JSON914.88 ± 2.2986883.59 ± 0.0291b5d7ef
YAJL (2.1.0) (C)JSON1589.58 ± 3.31125125.50 ± 0.0391b5d7ef

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Speed - Chromebook

These results are for an Acer C720 Chromebook. The tests are run on Arch Linux in recovery mode.

CPU model: Intel(R) Celeron(R) 2957U @ 1.40GHz
Architecture: x86_64
Bogomips: 2794.95

Small Data

Hash Comparisons

BenchmarkTime
(μs)
Code Size
(bytes)
Comparison
hash-data.c3.44 ± 0.0019336subtracted from Write tests
hash-object.c3.88 ± 0.0120016subtracted from Tree and Incremental tests

The Time column shows the total time taken to hash the expected output of the library in the test (the expected objects for Tree and Incremental tests, or a chunk of bytes roughly the size of encoded data for the Write tests.) The Code Size column shows the total code size of the benchmark harness, including object generation code (which is included in all tests.)

Write Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack2.19 ± 0.0940881.64 ± 0.031a9c6681
msgpack C++ (1.3.0) (C++)MessagePack3.44 ± 0.0586162.00 ± 0.011a9c6681
MPack (0.8.1) [tracking] (C)MessagePack7.93 ± 0.1553683.31 ± 0.041a9c6681
msgpack C (1.3.0) (C)MessagePack11.90 ± 0.1340884.46 ± 0.041a9c6681
CMP (v14) (C)MessagePack14.01 ± 0.0632325.08 ± 0.021a9c6681
MongoDB Legacy (1.1.0) (C++)BSON18.01 ± 0.101809526.24 ± 0.034e02a1f9
RapidJSON (1.0.2) (C++)JSON18.50 ± 0.11169046.38 ± 0.03e4495ccf
ubj (f4d85c4) (C)UBJSON20.58 ± 0.0633526.99 ± 0.02c1a19bb7
libbson (1.3.0) (C)BSON24.80 ± 0.10211128.22 ± 0.034e02a1f9
ubj (f4d85c4) [optimized] (C)UBJSON25.03 ± 0.0641848.29 ± 0.0237f97981
Binn (b3e2c27) (C)Binn30.28 ± 0.2982169.81 ± 0.08d7327409
YAJL (2.1.0) (C)JSON67.86 ± 0.47675220.75 ± 0.144694ca58
json-builder (19c739f) (C)JSON91.01 ± 1.20456027.49 ± 0.3575d4861f
Jansson (2.7) (C)JSON107.06 ± 0.251252832.16 ± 0.07c6e55bf0
Jansson (2.7) [ordered] (C)JSON128.56 ± 2.451270438.42 ± 0.7197b6e2b2

The Time and Code Size columns show the net result after subtracting the hash-data time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-data. In all three columns, lower is better.

Tree Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
libbson (1.3.0) (C)BSON4.49 ± 0.0634962.16 ± 0.020075ff81
MongoDB Legacy (1.1.0) (C++)BSON6.95 ± 0.071802802.79 ± 0.020075ff81
MPack (0.8.1) (C)MessagePack8.93 ± 0.0756243.30 ± 0.020075ff81
msgpack C (1.3.0) (C)MessagePack10.34 ± 0.0352003.66 ± 0.010075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack12.60 ± 0.0362004.25 ± 0.010075ff81
msgpack C++ (1.3.0) (C++)MessagePack13.15 ± 0.03191524.39 ± 0.010075ff81
Binn (b3e2c27) (C)Binn14.19 ± 0.0249444.66 ± 0.010075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON14.37 ± 0.05146004.70 ± 0.020075ff81
RapidJSON (1.0.2) (C++)JSON21.09 ± 0.08158006.43 ± 0.030075ff81
ubj (f4d85c4) [optimized] (C)UBJSON72.80 ± 1.381007219.76 ± 0.360075ff81
ubj (f4d85c4) (C)UBJSON79.54 ± 0.371007221.50 ± 0.110075ff81
json-parser (7053321) (C)JSON120.19 ± 1.01828831.98 ± 0.280075ff81
YAJL (2.1.0) (C)JSON165.11 ± 2.092259243.55 ± 0.550075ff81
Jansson (2.7) (C)JSON179.48 ± 2.961444047.26 ± 0.7742bf8b2f
Jansson (2.7) [ordered] (C)JSON186.65 ± 1.581479249.11 ± 0.430075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Incremental Parse Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
libbson (1.3.0) (C)BSON4.49 ± 0.0634962.16 ± 0.020075ff81
MPack (0.8.1) (C)MessagePack5.62 ± 0.0253362.45 ± 0.010075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON6.76 ± 0.0265042.74 ± 0.010075ff81
MongoDB Legacy (1.1.0) (C++)BSON6.95 ± 0.071802802.79 ± 0.020075ff81
MPack (0.8.1) [tracking] (C)MessagePack7.96 ± 0.0575523.05 ± 0.020075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack8.15 ± 0.0454643.10 ± 0.010075ff81
CMP (v14) (C)MessagePack11.55 ± 0.0934403.98 ± 0.030075ff81
Binn (b3e2c27) (C)Binn14.19 ± 0.0249444.66 ± 0.010075ff81
RapidJSON (1.0.2) (C++)JSON14.53 ± 0.0386884.75 ± 0.020075ff81
YAJL (2.1.0) (C)JSON34.08 ± 0.25125129.78 ± 0.070075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Large Data

Hash Comparisons

BenchmarkTime
(μs)
Code Size
(bytes)
Comparison
hash-data.c220.20 ± 0.0019336subtracted from Write tests
hash-object.c888.28 ± 0.2220016subtracted from Tree and Incremental tests

The Time column shows the total time taken to hash the expected output of the library in the test (the expected objects for Tree and Incremental tests, or a chunk of bytes roughly the size of encoded data for the Write tests.) The Code Size column shows the total code size of the benchmark harness, including object generation code (which is included in all tests.)

Write Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack856.44 ± 1.1940884.89 ± 0.01b4ac134d
msgpack C++ (1.3.0) (C++)MessagePack944.99 ± 1.7386165.29 ± 0.01b4ac134d
MPack (0.8.1) [tracking] (C)MessagePack1114.94 ± 0.8953686.06 ± 0.00b4ac134d
msgpack C (1.3.0) (C)MessagePack1338.33 ± 0.9640887.08 ± 0.00b4ac134d
CMP (v14) (C)MessagePack1463.82 ± 1.6432327.65 ± 0.01b4ac134d
MongoDB Legacy (1.1.0) (C++)BSON1528.28 ± 1.981809527.94 ± 0.0114d7b3b5
ubj (f4d85c4) (C)UBJSON1844.43 ± 2.9733529.38 ± 0.0112ead223
libbson (1.3.0) (C)BSON2003.89 ± 6.162111210.10 ± 0.0314d7b3b5
ubj (f4d85c4) [optimized] (C)UBJSON2117.18 ± 2.66418410.61 ± 0.018f23e492
RapidJSON (1.0.2) (C++)JSON2136.34 ± 1.111690410.70 ± 0.01a1ab8d87
Binn (b3e2c27) (C)Binn3492.20 ± 7.97821616.86 ± 0.0407910350
YAJL (2.1.0) (C)JSON6091.83 ± 25.31675228.66 ± 0.1111ddf727
json-builder (19c739f) (C)JSON11446.17 ± 489.65456052.98 ± 2.229061166e
Jansson (2.7) (C)JSON12823.71 ± 195.061252859.24 ± 0.8971b6803d
Jansson (2.7) [ordered] (C)JSON14258.16 ± 222.041270465.75 ± 1.0103e30c6f

The Time and Code Size columns show the net result after subtracting the hash-data time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-data. In all three columns, lower is better.

Tree Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
libbson (1.3.0) (C)BSON512.67 ± 1.1834961.58 ± 0.0091b5d7ef
MongoDB Legacy (1.1.0) (C++)BSON618.37 ± 1.921802801.70 ± 0.0091b5d7ef
MPack (0.8.1) (C)MessagePack819.70 ± 0.9856241.92 ± 0.0091b5d7ef
msgpack C (1.3.0) (C)MessagePack1264.30 ± 2.0352002.42 ± 0.0091b5d7ef
MPack (0.8.1) [UTF-8] (C)MessagePack1319.61 ± 1.9462002.49 ± 0.0091b5d7ef
Binn (b3e2c27) (C)Binn1320.63 ± 0.8349442.49 ± 0.0091b5d7ef
msgpack C++ (1.3.0) (C++)MessagePack1852.49 ± 1.76191523.09 ± 0.0091b5d7ef
RapidJSON (1.0.2) [in-situ] (C++)JSON2135.78 ± 3.23146003.40 ± 0.0091b5d7ef
RapidJSON (1.0.2) (C++)JSON3148.26 ± 8.94158004.54 ± 0.0191b5d7ef
ubj (f4d85c4) [optimized] (C)UBJSON6605.73 ± 14.05100728.44 ± 0.0291b5d7ef
ubj (f4d85c4) (C)UBJSON8497.19 ± 89.181007210.57 ± 0.1091b5d7ef
json-parser (7053321) (C)JSON12027.21 ± 29.90828814.54 ± 0.0391b5d7ef
YAJL (2.1.0) (C)JSON17193.97 ± 21.952259220.36 ± 0.0391b5d7ef
Jansson (2.7) (C)JSON18217.32 ± 19.851444021.51 ± 0.027eeb34f1
Jansson (2.7) [ordered] (C)JSON19240.90 ± 409.691479222.66 ± 0.4691b5d7ef

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Incremental Parse Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack407.82 ± 1.1753361.46 ± 0.0091b5d7ef
MPack (0.8.1) [tracking] (C)MessagePack495.80 ± 0.4975521.56 ± 0.0091b5d7ef
libbson (1.3.0) (C)BSON512.67 ± 1.1834961.58 ± 0.0091b5d7ef
MongoDB Legacy (1.1.0) (C++)BSON618.37 ± 1.921802801.70 ± 0.0091b5d7ef
MPack (0.8.1) [UTF-8] (C)MessagePack844.49 ± 3.8054641.95 ± 0.0091b5d7ef
RapidJSON (1.0.2) [in-situ] (C++)JSON883.71 ± 1.4465041.99 ± 0.0091b5d7ef
CMP (v14) (C)MessagePack899.51 ± 1.3434402.01 ± 0.0091b5d7ef
Binn (b3e2c27) (C)Binn1320.63 ± 0.8349442.49 ± 0.0091b5d7ef
RapidJSON (1.0.2) (C++)JSON1699.81 ± 7.3586882.91 ± 0.0191b5d7ef
YAJL (2.1.0) (C)JSON2822.65 ± 6.66125124.18 ± 0.0191b5d7ef

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Speed - Raspberry Pi

These results are for a speed-optimized build (-O3 -flto) on a first-generation Raspberry Pi, running a fresh install of Arch Linux ARM.

CPU model: ARMv6-compatible processor rev 7 (v6l)
Hardware Revision: 000f (Model B rev2, 512 MB RAM)

Small Data

Hash Comparisons

BenchmarkTime
(μs)
Code Size
(bytes)
Comparison
hash-data.c30.31 ± 0.0316112subtracted from Write tests
hash-object.c36.07 ± 0.1517104subtracted from Tree and Incremental tests

The Time column shows the total time taken to hash the expected output of the library in the test (the expected objects for Tree and Incremental tests, or a chunk of bytes roughly the size of encoded data for the Write tests.) The Code Size column shows the total code size of the benchmark harness, including object generation code (which is included in all tests.)

Write Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack38.31 ± 0.1840322.26 ± 0.011a9c6681
msgpack C++ (1.3.0) (C++)MessagePack38.36 ± 0.4176282.27 ± 0.011a9c6681
msgpack C (1.3.0) (C)MessagePack69.21 ± 0.3743843.28 ± 0.011a9c6681
MPack (0.8.1) [tracking] (C)MessagePack81.95 ± 0.3754403.70 ± 0.011a9c6681
CMP (v14) (C)MessagePack89.75 ± 0.1133963.96 ± 0.011a9c6681
ubj (f4d85c4) (C)UBJSON159.36 ± 0.3836646.26 ± 0.01c1a19bb7
MongoDB Legacy (1.1.0) (C++)BSON188.51 ± 0.261604447.22 ± 0.014e02a1f9
ubj (f4d85c4) [optimized] (C)UBJSON194.92 ± 0.2944487.43 ± 0.0137f97981
libbson (1.3.0) (C)BSON229.45 ± 0.41176048.57 ± 0.024e02a1f9
RapidJSON (1.0.2) (C++)JSON231.33 ± 1.10181248.63 ± 0.04e4495ccf
Binn (b3e2c27) (C)Binn508.11 ± 8.82868817.76 ± 0.29d7327409
YAJL (2.1.0) (C)JSON752.41 ± 12.40684025.82 ± 0.414694ca58
json-builder (19c739f) (C)JSON1539.33 ± 11.29439251.78 ± 0.3875d4861f
Jansson (2.7) (C)JSON1789.29 ± 12.161488460.03 ± 0.40eb946daf
Jansson (2.7) [ordered] (C)JSON2089.40 ± 21.091534469.93 ± 0.7097b6e2b2

The Time and Code Size columns show the net result after subtracting the hash-data time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-data. In all three columns, lower is better.

Tree Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
libbson (1.3.0) (C)BSON63.48 ± 0.3638762.76 ± 0.010075ff81
MPack (0.8.1) (C)MessagePack69.05 ± 0.5556122.91 ± 0.020075ff81
MongoDB Legacy (1.1.0) (C++)BSON84.01 ± 0.381596483.33 ± 0.020075ff81
msgpack C (1.3.0) (C)MessagePack87.54 ± 0.3758843.43 ± 0.020075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack99.39 ± 0.4462123.76 ± 0.020075ff81
Binn (b3e2c27) (C)Binn141.18 ± 0.7044964.91 ± 0.030075ff81
msgpack C++ (1.3.0) (C++)MessagePack142.66 ± 0.50173004.96 ± 0.020075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON170.34 ± 0.38136845.72 ± 0.030075ff81
RapidJSON (1.0.2) (C++)JSON245.59 ± 0.89184407.81 ± 0.040075ff81
ubj (f4d85c4) [optimized] (C)UBJSON1137.63 ± 5.15883632.54 ± 0.190075ff81
ubj (f4d85c4) (C)UBJSON1491.61 ± 23.82884442.36 ± 0.680075ff81
json-parser (7053321) (C)JSON1751.27 ± 9.72731649.56 ± 0.340075ff81
Jansson (2.7) (C)JSON2604.03 ± 31.411684873.20 ± 0.92e5cef7b9
Jansson (2.7) [ordered] (C)JSON2795.44 ± 87.161708478.51 ± 2.440075ff81
YAJL (2.1.0) (C)JSON3416.81 ± 26.221863295.74 ± 0.820075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Incremental Parse Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack29.45 ± 0.2954601.82 ± 0.010075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack57.81 ± 0.2354602.60 ± 0.010075ff81
libbson (1.3.0) (C)BSON63.48 ± 0.3638762.76 ± 0.010075ff81
MPack (0.8.1) [tracking] (C)MessagePack66.11 ± 0.3567722.83 ± 0.010075ff81
MongoDB Legacy (1.1.0) (C++)BSON84.01 ± 0.381596483.33 ± 0.020075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON99.28 ± 0.2663683.75 ± 0.020075ff81
CMP (v14) (C)MessagePack100.14 ± 0.2233163.78 ± 0.020075ff81
Binn (b3e2c27) (C)Binn141.18 ± 0.7044964.91 ± 0.030075ff81
RapidJSON (1.0.2) (C++)JSON145.68 ± 0.27114165.04 ± 0.020075ff81
YAJL (2.1.0) (C)JSON349.72 ± 2.621182010.70 ± 0.080075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Large Data

Hash Comparisons

BenchmarkTime
(μs)
Code Size
(bytes)
Comparison
hash-data.c3956.91 ± 0.3316112subtracted from Write tests
hash-object.c6161.16 ± 1.2017104subtracted from Tree and Incremental tests

The Time column shows the total time taken to hash the expected output of the library in the test (the expected objects for Tree and Incremental tests, or a chunk of bytes roughly the size of encoded data for the Write tests.) The Code Size column shows the total code size of the benchmark harness, including object generation code (which is included in all tests.)

Write Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack5610.92 ± 9.5840322.42 ± 0.00b4ac134d
msgpack C++ (1.3.0) (C++)MessagePack6098.33 ± 8.5076282.54 ± 0.00b4ac134d
msgpack C (1.3.0) (C)MessagePack8142.64 ± 7.7843843.06 ± 0.00b4ac134d
MPack (0.8.1) [tracking] (C)MessagePack8241.74 ± 9.8154403.08 ± 0.00b4ac134d
CMP (v14) (C)MessagePack9206.05 ± 11.8533963.33 ± 0.00b4ac134d
RapidJSON (1.0.2) (C++)JSON15235.80 ± 8.42181244.85 ± 0.00a1ab8d87
ubj (f4d85c4) (C)UBJSON15446.15 ± 62.0536644.90 ± 0.0212ead223
MongoDB Legacy (1.1.0) (C++)BSON15984.76 ± 16.451604445.04 ± 0.0014d7b3b5
ubj (f4d85c4) [optimized] (C)UBJSON16971.06 ± 58.2644485.29 ± 0.018f23e492
libbson (1.3.0) (C)BSON18287.50 ± 31.43176045.62 ± 0.0114d7b3b5
Binn (b3e2c27) (C)Binn39203.27 ± 309.77868810.91 ± 0.0807910350
YAJL (2.1.0) (C)JSON61838.05 ± 1453.54684016.63 ± 0.3711ddf727
json-builder (19c739f) (C)JSON145811.52 ± 384.95439237.85 ± 0.109061166e
Jansson (2.7) (C)JSON151609.98 ± 828.701488439.32 ± 0.21e766b568
Jansson (2.7) [ordered] (C)JSON166935.57 ± 2095.521534443.19 ± 0.5303e30c6f

The Time and Code Size columns show the net result after subtracting the hash-data time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-data. In all three columns, lower is better.

Tree Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
libbson (1.3.0) (C)BSON2745.93 ± 1.8338761.45 ± 0.0091b5d7ef
MongoDB Legacy (1.1.0) (C++)BSON4315.50 ± 2.121596481.70 ± 0.0091b5d7ef
MPack (0.8.1) (C)MessagePack6316.98 ± 33.6056122.03 ± 0.0191b5d7ef
Binn (b3e2c27) (C)Binn7053.49 ± 20.2944962.14 ± 0.0091b5d7ef
MPack (0.8.1) [UTF-8] (C)MessagePack9447.64 ± 23.8162122.53 ± 0.0091b5d7ef
msgpack C (1.3.0) (C)MessagePack10287.89 ± 25.0458842.67 ± 0.0091b5d7ef
msgpack C++ (1.3.0) (C++)MessagePack13581.87 ± 16.42173003.20 ± 0.0091b5d7ef
RapidJSON (1.0.2) [in-situ] (C++)JSON17504.30 ± 18.48136843.84 ± 0.0091b5d7ef
RapidJSON (1.0.2) (C++)JSON24390.81 ± 26.50184404.96 ± 0.0091b5d7ef
ubj (f4d85c4) [optimized] (C)UBJSON71491.44 ± 183.08883612.60 ± 0.0391b5d7ef
ubj (f4d85c4) (C)UBJSON94270.72 ± 712.07884416.30 ± 0.1291b5d7ef
json-parser (7053321) (C)JSON131013.22 ± 236.49731622.26 ± 0.0491b5d7ef
Jansson (2.7) (C)JSON187014.94 ± 4164.801684831.35 ± 0.682a98f785
Jansson (2.7) [ordered] (C)JSON197942.32 ± 6581.881708433.13 ± 1.0791b5d7ef
YAJL (2.1.0) (C)JSON227495.40 ± 4909.911863237.92 ± 0.8091b5d7ef

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Incremental Parse Test

LibraryFormatTime
(μs) ▲
Code Size
(bytes)
Time
Overhead
Hash
MPack (0.8.1) (C)MessagePack361.43 ± 35.2454601.06 ± 0.0191b5d7ef
MPack (0.8.1) [tracking] (C)MessagePack2627.60 ± 38.4567721.43 ± 0.0191b5d7ef
libbson (1.3.0) (C)BSON2745.93 ± 1.8338761.45 ± 0.0091b5d7ef
MPack (0.8.1) [UTF-8] (C)MessagePack3335.67 ± 34.9554601.54 ± 0.0191b5d7ef
MongoDB Legacy (1.1.0) (C++)BSON4315.50 ± 2.121596481.70 ± 0.0091b5d7ef
CMP (v14) (C)MessagePack5713.58 ± 27.3033161.93 ± 0.0091b5d7ef
Binn (b3e2c27) (C)Binn7053.49 ± 20.2944962.14 ± 0.0091b5d7ef
RapidJSON (1.0.2) [in-situ] (C++)JSON7387.73 ± 12.1263682.20 ± 0.0091b5d7ef
RapidJSON (1.0.2) (C++)JSON11792.55 ± 5.21114162.91 ± 0.0091b5d7ef
YAJL (2.1.0) (C)JSON24252.07 ± 234.90118204.94 ± 0.0491b5d7ef

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Size - Raspberry Pi

These results are for a size-optimized build (-Os -flto) on a first-generation Raspberry Pi, running a fresh install of Arch Linux ARM.

For brevity we are only showing the results for a Raspberry Pi with small data, since you probably aren't worried about size optimization on desktops and servers, or parsing large data files on a Raspberry Pi.

The tables are sorted by code size.

Small Data

Hash Comparisons

BenchmarkTime
(μs)
Code Size
(bytes)
Comparison
hash-data.c37.29 ± 0.039036subtracted from Write tests
hash-object.c43.94 ± 0.349488subtracted from Tree and Incremental tests

The Time column shows the total time taken to hash the expected output of the library in the test (the expected objects for Tree and Incremental tests, or a chunk of bytes roughly the size of encoded data for the Write tests.) The Code Size column shows the total code size of the benchmark harness, including object generation code (which is included in all tests.)

Write Test

LibraryFormatTime
(μs)
Code Size
(bytes) ▲
Time
Overhead
Hash
msgpack C (1.3.0) (C)MessagePack67.35 ± 0.1915282.81 ± 0.011a9c6681
ubj (f4d85c4) (C)UBJSON189.24 ± 0.5017766.07 ± 0.01c1a19bb7
CMP (v14) (C)MessagePack100.66 ± 0.2623243.70 ± 0.011a9c6681
ubj (f4d85c4) [optimized] (C)UBJSON240.83 ± 0.1523527.46 ± 0.0137f97981
MPack (0.8.1) (C)MessagePack38.90 ± 0.2131242.04 ± 0.011a9c6681
json-builder (19c739f) (C)JSON1551.66 ± 12.47317642.61 ± 0.3475d4861f
msgpack C++ (1.3.0) (C++)MessagePack68.38 ± 0.2133242.83 ± 0.011a9c6681
MPack (0.8.1) [tracking] (C)MessagePack107.05 ± 0.4239603.87 ± 0.011a9c6681
Binn (b3e2c27) (C)Binn516.18 ± 5.71443214.84 ± 0.15d7327409
YAJL (2.1.0) (C)JSON757.12 ± 18.04601221.30 ± 0.484694ca58
RapidJSON (1.0.2) (C++)JSON345.26 ± 0.74832810.26 ± 0.02e4495ccf
Jansson (2.7) (C)JSON1883.20 ± 17.471057651.50 ± 0.47ab18ef6f
Jansson (2.7) [ordered] (C)JSON2207.44 ± 29.751087660.19 ± 0.8097b6e2b2
libbson (1.3.0) (C)BSON264.93 ± 1.11141928.10 ± 0.034e02a1f9
MongoDB Legacy (1.1.0) (C++)BSON270.70 ± 1.231605008.26 ± 0.034e02a1f9

The Time and Code Size columns show the net result after subtracting the hash-data time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-data. In all three columns, lower is better.

Tree Test

LibraryFormatTime
(μs)
Code Size
(bytes) ▲
Time
Overhead
Hash
Binn (b3e2c27) (C)Binn175.29 ± 0.4430084.99 ± 0.040075ff81
MPack (0.8.1) (C)MessagePack90.79 ± 0.4331923.07 ± 0.020075ff81
libbson (1.3.0) (C)BSON84.31 ± 0.4232522.92 ± 0.020075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack127.18 ± 0.8937483.89 ± 0.040075ff81
ubj (f4d85c4) [optimized] (C)UBJSON1241.77 ± 15.03384429.26 ± 0.410075ff81
ubj (f4d85c4) (C)UBJSON1637.14 ± 25.18385238.26 ± 0.640075ff81
msgpack C (1.3.0) (C)MessagePack107.23 ± 0.5739483.44 ± 0.030075ff81
json-parser (7053321) (C)JSON1772.10 ± 2.94655241.33 ± 0.320075ff81
RapidJSON (1.0.2) (C++)JSON504.28 ± 0.71907612.48 ± 0.100075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON322.89 ± 0.7492368.35 ± 0.070075ff81
msgpack C++ (1.3.0) (C++)MessagePack175.38 ± 0.55110444.99 ± 0.040075ff81
Jansson (2.7) (C)JSON2822.15 ± 51.681347665.23 ± 1.288eaff739
Jansson (2.7) [ordered] (C)JSON2895.82 ± 8.301368066.90 ± 0.550075ff81
YAJL (2.1.0) (C)JSON3339.01 ± 72.531397276.99 ± 1.750075ff81
MongoDB Legacy (1.1.0) (C++)BSON89.95 ± 0.401610963.05 ± 0.020075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.

Incremental Parse Test

LibraryFormatTime
(μs)
Code Size
(bytes) ▲
Time
Overhead
Hash
Binn (b3e2c27) (C)Binn175.29 ± 0.4430084.99 ± 0.040075ff81
CMP (v14) (C)MessagePack107.18 ± 0.3431923.44 ± 0.030075ff81
MPack (0.8.1) (C)MessagePack87.52 ± 0.3832082.99 ± 0.020075ff81
libbson (1.3.0) (C)BSON84.31 ± 0.4232522.92 ± 0.020075ff81
MPack (0.8.1) [UTF-8] (C)MessagePack122.76 ± 0.4435443.79 ± 0.030075ff81
MPack (0.8.1) [tracking] (C)MessagePack155.88 ± 0.4239244.55 ± 0.040075ff81
RapidJSON (1.0.2) [in-situ] (C++)JSON207.46 ± 0.3642845.72 ± 0.040075ff81
RapidJSON (1.0.2) (C++)JSON359.65 ± 0.4549209.19 ± 0.070075ff81
YAJL (2.1.0) (C)JSON376.31 ± 2.85101809.56 ± 0.100075ff81
MongoDB Legacy (1.1.0) (C++)BSON89.95 ± 0.401610963.05 ± 0.020075ff81

The Time and Code Size columns show the net result after subtracting the hash-object time and size. The Time Overhead column shows the total time of the benchmark divided by the total time of hash-object. In all three columns, lower is better.