Skip to content

Instantly share code, notes, and snippets.

@nigeltao
Created August 25, 2017 02:47
Show Gist options
  • Save nigeltao/5deba67065a302ebe9ac342235a709c2 to your computer and use it in GitHub Desktop.
Save nigeltao/5deba67065a302ebe9ac342235a709c2 to your computer and use it in GitHub Desktop.
inffast64.c benchmarks
Speed up inflate_fast by up to 1.5x on x86_64.
https://github.com/google/snappy is an unrelated compression format but
its snappy_unittest program is able to benchmark the snappy library and
the zlib library. We can re-purpose it, via LD_LIBRARY_PATH, to measure
different versions of zlib, such as before / after this commit.
snappy_unittest's output looks like:
testdata/alice29.txt :
ZLIB: [b 1M] bytes 152089 -> 54404 35.8% comp 19.6 MB/s uncomp 258.2 MB/s
testdata/asyoulik.txt :
ZLIB: [b 1M] bytes 125179 -> 48897 39.1% comp 17.9 MB/s uncomp 242.9 MB/s
etc
and summarizing the before/after zlib uncompress numbers give:
alice29.txt uncomp MB/s before 258.2 after 392.4 ratio 1.52
asyoulik.txt uncomp MB/s before 242.9 after 346.6 ratio 1.43
fireworks.jpeg uncomp MB/s before 1066.7 after 1194.7 ratio 1.12
geo.protodata uncomp MB/s before 565.6 after 756.8 ratio 1.34
html uncomp MB/s before 492.1 after 698.8 ratio 1.42
html_x_4 uncomp MB/s before 502.1 after 697.8 ratio 1.39
kppkn.gtb uncomp MB/s before 336.4 after 483.6 ratio 1.44
lcet10.txt uncomp MB/s before 265.2 after 409.5 ratio 1.54
paper-100k.pdf uncomp MB/s before 264.9 after 331.4 ratio 1.25
plrabn12.txt uncomp MB/s before 240.9 after 372.5 ratio 1.55
urls.10K uncomp MB/s before 280.7 after 381.3 ratio 1.36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment