Howard Chu wrote:
Was reading thru Google's leveldb stuff and found their benchmark page
I haven't duplicated all of the test scenarios described on the web page yet, you can do that yourself with the attached code. It's pretty clear that nothing else even begins to approach MDB's read speed.
The results for large data values are even more dramatic:
For leveldb: violino:/home/software/leveldb> ./db_bench --value_size=100000 --num=1000 LevelDB: version 1.5 Date: Mon Jul 2 08:08:51 2012 CPU: 4 * Intel(R) Core(TM)2 Extreme CPU Q9300 @ 2.53GHz CPUCache: 6144 KB Keys: 16 bytes each Values: 100000 bytes each (50000 bytes after compression) Entries: 1000 RawSize: 95.4 MB (estimated) FileSize: 47.7 MB (estimated) WARNING: Snappy compression is not enabled ------------------------------------------------ fillseq : 293.817 micros/op; 324.6 MB/s fillsync : 10305.000 micros/op; 9.3 MB/s (1 ops) fillrandom : 467.954 micros/op; 203.8 MB/s overwrite : 873.647 micros/op; 109.2 MB/s readrandom : 59.306 micros/op; (1000 of 1000 found) readrandom : 38.869 micros/op; (1000 of 1000 found) readseq : 3.762 micros/op; 25353.9 MB/s readreverse : 67.664 micros/op; 1409.7 MB/s compact : 327394.000 micros/op; readrandom : 35.603 micros/op; (1000 of 1000 found) readseq : 1.518 micros/op; 62847.5 MB/s readreverse : 19.971 micros/op; 4776.0 MB/s fill100K : 6584.000 micros/op; 14.5 MB/s (1 ops) crc32c : 3.929 micros/op; 994.2 MB/s (4K per op) snappycomp : 10660.000 micros/op; (snappy failure) snappyuncomp : 8547.000 micros/op; (snappy failure) acquireload : 0.386 micros/op; (each op is 1000 loads)
For MDB: violino:/home/software/leveldb> ./db_bench_mdb --value_size=100000 --num=1000 MDB: version MDB 0.9.0: ("September 1, 2011") Date: Mon Jul 2 08:09:17 2012 CPU: 4 * Intel(R) Core(TM)2 Extreme CPU Q9300 @ 2.53GHz CPUCache: 6144 KB Keys: 16 bytes each Values: 100000 bytes each (50000 bytes after compression) Entries: 1000 RawSize: 95.4 MB (estimated) FileSize: 47.7 MB (estimated) ------------------------------------------------ fillseq : 89.330 micros/op; 1067.8 MB/s fillseqsync : 124.788 micros/op; 764.4 MB/s (10 ops) fillseqbatch : 152.159 micros/op; 626.9 MB/s fillrandom : 103.817 micros/op; 918.8 MB/s fillrandint : 105.732 micros/op; 902.0 MB/s fillrandibatch : 115.781 micros/op; 823.7 MB/s fillrandsync : 130.296 micros/op; 732.0 MB/s (10 ops) fillrandbatch : 113.984 micros/op; 836.8 MB/s overwrite : 105.091 micros/op; 907.6 MB/s overwritebatch : 101.044 micros/op; 944.0 MB/s readrandom : 0.303 micros/op; readseq : 0.142 micros/op; 671485.5 MB/s readreverse : 0.084 micros/op; 1131133.3 MB/s fillrand100K : 136.852 micros/op; 697.0 MB/s (1 ops) fillseq100K : 158.787 micros/op; 600.7 MB/s (1 ops) readseq100K : 9.060 micros/op; 10528.0 MB/s readrand100K : 5.007 micros/op;
MDB's zero-memcpy reads means read ops are essentially constant speed, independent of data volume. MDB's overflow-page handling makes large writes extremely cheap, and this advantage totally offsets the overhead of the copy-on-write tree management.