Skip to content

Instantly share code, notes, and snippets.

@KungFuJesus
KungFuJesus / 2353.md
Created July 3, 2026 15:44
PR 2353 Cascade Lake bench results
adam@eggsbenedict ~/scratch/zlib-ng/build/test/benchmarks $ setarch `uname -m` -R taskset -c 0 python ./compare.py -a benchmarksfiltered ./benchmark_zlib_old inflate_corpora ./benchmark_zlib inflate_corpora --benchmark_repetitions=10
RUNNING: ./benchmark_zlib_old --benchmark_repetitions=10 --benchmark_display_aggregates_only=true --benchmark_filter=inflate_corpora --benchmark_out=/tmp/tmp4kubc631
2026-07-03T11:24:39-04:00
Running ./benchmark_zlib_old
Run on (28 X 4100 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x14)
  L1 Instruction 32 KiB (x14)
  L2 Unified 1024 KiB (x14)
@KungFuJesus
KungFuJesus / deflate-ppc970.md
Last active June 29, 2026 02:42
Deflate zlib-rs vs zlib-ng, G5, post 2253
adam@g5box ~/zlib-ng/build-zlibrs-bench/test/benchmarks $ setarch `uname -m` -R taskset -c 0 python ./compare.py -a benchmarksfiltered ./benchmark_zlib_rs deflate_corpora ./benchmark_zlib deflate_corpora --benchmark_repetitions=10
RUNNING: ./benchmark_zlib_rs --benchmark_repetitions=10 --benchmark_display_aggregates_only=true --benchmark_filter=deflate_corpora --benchmark_out=/tmp/tmpkqxl4n8x
2026-06-28T21:04:47-04:00
Running ./benchmark_zlib_rs
Run on (4 X 2500 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x4)
  L1 Instruction 64 KiB (x4)
  L2 Unified 1024 KiB (x4)
@KungFuJesus
KungFuJesus / ppc970.md
Created June 29, 2026 01:03
zlib-rs vs zlib-ng inflate, ppc970MP, post #2253
adam@g5box ~/zlib-ng/build-zlibrs-bench/test/benchmarks $ cat /proc/cpuinfo 
processor	: 0
cpu		: PPC970MP, altivec supported
clock		: 2500.000000MHz
revision	: 1.1 (pvr 0044 0101)

processor	: 1
cpu		: PPC970MP, altivec supported
clock		: 2500.000000MHz
@KungFuJesus
KungFuJesus / deflate-bench.md
Created June 28, 2026 16:15
Post #2253 zlib-rs vs zlib-ng deflate
Comparing deflate_corpora (from ./benchmark_zlib_rs) to deflate_corpora (from ./benchmark_zlib)
Benchmark                                                                                          Time             CPU      Time Old      Time New       CPU Old       CPU New
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[deflate_corpora vs. deflate_corpora]/artificial/a.txt/level:1_pvalue                            0.0002          0.0002      U Test, Repetitions: 10 vs 10
[deflate_corpora vs. deflate_corpora]/artificial/a.txt/level:1_mean                             -0.4909         -0.4909          3635          1851          3635          1851
[deflate_corpora vs. deflate_corpora]/artificial/a.txt/level:1_median                           -0.4512         -0.4512          3329          1827          3329          1827
[deflate_corpora vs. deflate_corpora]/artificial/a.txt/level:1_st
@KungFuJesus
KungFuJesus / post2253-bench.md
Created June 27, 2026 20:20
Deflate benchmarks after #2253
adam@eggsbenedict ~/scratch/zlib-ng/build/test/benchmarks $ setarch `uname -m` -R taskset -c 0 ./benchmark_zlib --benchmark_filter=deflate_corpora --benchmark_repetitions=10 --benchmark_report_aggregates_only
2026-06-27T15:43:42-04:00
Running ./benchmark_zlib
Run on (28 X 4100 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x14)
  L1 Instruction 32 KiB (x14)
  L2 Unified 1024 KiB (x14)
  L3 Unified 19712 KiB (x1)
@KungFuJesus
KungFuJesus / gist:1929d225fc94e44077ca94b6d2d25c7f
Created June 27, 2026 16:58
zlib-rs vs zlib-ng deflate benchmarks
adam@eggsbenedict ~/scratch/zlib-ng/build/test/benchmarks $ setarch `uname -m` -R taskset -c 0 python ./compare.py -a benchmarksfiltered ./benchmark_zlib_rs deflate_corpora ./benchmark_zlib deflate_corpora --benchmark_repetitions=10
RUNNING: ./benchmark_zlib_rs --benchmark_repetitions=10 --benchmark_display_aggregates_only=true --benchmark_filter=deflate_corpora --benchmark_out=/tmp/tmp_necc4gu
2026-06-27T11:40:59-04:00
Running ./benchmark_zlib_rs
Run on (28 X 4099.99 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x14)
  L1 Instruction 32 KiB (x14)
  L2 Unified 1024 KiB (x14)
@KungFuJesus
KungFuJesus / gist:3b779cdecc2ea86bcbf203d3c3f7694e
Last active June 27, 2026 17:02
zlib-ng vs zlib-rs inflate benchmarks

These are my attempts at an honest benchmark comparison using real data. We leverage our own internal google benchmark based harness with our test corpora.

The comparisons that are blogged about writ large tend to be against the latest release tag. Zlib-ng has made some serious advancements in performance since the last release that hasn't been captured. The benchmarks provided by the zlib-rs project to date have seem to also have come from relaunching the benchmark binary over and over as well, which can capture a fair bit of variance from the system calls ingesting the files. These benchmarks attempt to capture the raw inflate time after we initialize our test harness. The microbenchmark framework of google bench lends itself well to baking things into steady state behavior.

This particular test machine's CPU is:

processor	: 0
vendor_id	: GenuineIntel
Comparing png_decode_re (from ./benchmark_zlib_apps_old) to png_decode_re (from ./benchmark_zlib_apps)
Benchmark Time CPU Time Old Time New CPU Old CPU New
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
[png_decode_re vs. png_decode_re]alistic/[png_decode_re vs. png_decode_re]alistic/0_pvalue 0.0036 0.0036 U Test, Repetitions: 10 vs 10
[png_decode_re vs. png_decode_re]alistic/[png_decode_re vs. png_decode_re]alistic/0_mean -0.0063 -0.0063 9637 9576 9637 9576
[png_decode_re vs. png_decode_re]alistic/[png_decode_re vs. png_decode_re]alistic/0_median -0.0074 -0.0074 9641 9569 9640 9569
[png_decode_
@KungFuJesus
KungFuJesus / gist:d649a1a3879b1b2823f92e442c41613c
Created August 24, 2022 17:31
Benchmarks zlib-dougallj vs zlib-ng (realistically compressible)
RUNNING: ./benchmark_zlib_apps_alt --benchmark_repetitions=10 --benchmark_display_aggregates_only=true --benchmark_filter=png_decode_re --benchmark_out=/tmp/tmpi2ugdndb
2022-08-24T13:28:49-04:00
Running ./benchmark_zlib_apps_alt
Run on (28 X 2508.39 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x14)
L1 Instruction 32 KiB (x14)
L2 Unified 1024 KiB (x14)
L3 Unified 19712 KiB (x1)
Load Average: 0.71, 0.54, 0.37
@KungFuJesus
KungFuJesus / gist:24cca05e5d9283bc0d5fc74385ba5a90
Created August 24, 2022 17:26
Benchmarks zlib-dougallj vs zlib-ng (unrealistically compressible)
RUNNING: ./benchmark_zlib_apps_alt --benchmark_repetitions=10 --benchmark_display_aggregates_only=true --benchmark_filter=png_decode/ --benchmark_out=/tmp/tmpz15lkbmi
2022-08-24T13:23:32-04:00
Running ./benchmark_zlib_apps_alt
Run on (28 X 4097.68 MHz CPU s)
CPU Caches:
L1 Data 32 KiB (x14)
L1 Instruction 32 KiB (x14)
L2 Unified 1024 KiB (x14)
L3 Unified 19712 KiB (x1)
Load Average: 0.56, 0.29, 0.22