Benchmark numbers are better for gcc and worse for clang, but clang 3.8
is also relatively old. Given gcc's speeds, it's arguably a clang
codegen bug, or at least it should be clang's aspirational target.
name old speed new speed delta
wuffs_deflate_decode_1k/clang 142MB/s ± 1% 135MB/s ± 1% -4.54% (p=0.008 n=5+5)
wuffs_deflate_decode_10k/clang 295MB/s ± 0% 291MB/s ± 0% -1.09% (p=0.008 n=5+5)
wuffs_deflate_decode_100k/clang 354MB/s ± 1% 342MB/s ± 0% -3.48% (p=0.008 n=5+5)
wuffs_deflate_decode_1k/gcc 153MB/s ± 1% 156MB/s ± 1% +1.51% (p=0.008 n=5+5)
wuffs_deflate_decode_10k/gcc 354MB/s ± 1% 371MB/s ± 0% +4.92% (p=0.008 n=5+5)
wuffs_deflate_decode_100k/gcc 468MB/s ± 2% 499MB/s ± 1% +6.64% (p=0.008 n=5+5)
Note that these are benchmark numbers for an 'ideal', hand-written C
implementation, not for Wuffs' generated C code.
Benchmark numbers are better for gcc and worse for clang, but clang 3.8
is also relatively old. Given gcc's speeds, it's arguably a clang
codegen bug, or at least it should be clang's aspirational target.
name old speed new speed delta
wuffs_deflate_decode_1k/clang 157MB/s ± 1% 142MB/s ± 1% -9.47% (p=0.008 n=5+5)
wuffs_deflate_decode_10k/clang 313MB/s ± 0% 295MB/s ± 0% -5.98% (p=0.008 n=5+5)
wuffs_deflate_decode_100k/clang 403MB/s ± 1% 354MB/s ± 1% -12.12% (p=0.008 n=5+5)
wuffs_deflate_decode_1k/gcc 165MB/s ± 1% 153MB/s ± 1% -6.93% (p=0.008 n=5+5)
wuffs_deflate_decode_10k/gcc 337MB/s ± 0% 354MB/s ± 1% +4.90% (p=0.008 n=5+5)
wuffs_deflate_decode_100k/gcc 440MB/s ± 0% 468MB/s ± 2% +6.24% (p=0.008 n=5+5)
Note that these are benchmark numbers for an 'ideal', hand-written C
implementation, not for Wuffs' generated C code.
On my machine (Debian Testing as of November 2017, Intel x86_64
Broadwell):
Rust 28.0 rustc 1.14 github.com/Geal/gif.rs
Rust 29.1 rustc 1.14 github.com/PistonDevelopers/image-gif
Go 62.7 go 1.9 standard library's image/gif
C 97.3 giflib 5.1 from Debian Testing's /usr/lib
Wuffs 123 clang 5.0
Wuffs 136 gcc 7.2
Numbers are megabytes per second, equivalent to megapixels per second
for GIF images.
There may be future bench-go-xxx programs, or of other languages.
On my machine, the throughput number that the program output also
changes from 24.7 (as reported in a prior commit message) to 28.0
megapixels per second. This is not due to any code changes, but because
in the meantime, I have also used the "cpupower" command line tool to
change policy from "powersave" to "performance".
We're possibly overfitting now on the very small benchmark corpus (3
files), but we can test on larger corpuses later. Algorithmically, it
does match what zlib does.
name old speed new speed delta
puffs_flate_decode_1k/clang 188MB/s ± 0% 191MB/s ± 1% +1.55% (p=0.008 n=5+5)
puffs_flate_decode_10k/clang 242MB/s ± 2% 277MB/s ± 1% +14.72% (p=0.008 n=5+5)
puffs_flate_decode_100k/clang 273MB/s ± 1% 315MB/s ± 1% +15.63% (p=0.008 n=5+5)
puffs_flate_decode_1k/gcc 187MB/s ± 0% 194MB/s ± 2% +3.56% (p=0.008 n=5+5)
puffs_flate_decode_10k/gcc 242MB/s ± 0% 279MB/s ± 1% +15.29% (p=0.016 n=5+4)
puffs_flate_decode_100k/gcc 288MB/s ± 1% 315MB/s ± 0% +9.29% (p=0.008 n=5+5)
Note that these are benchmark numbers for an 'ideal', hand-written C
implementation, not for Puffs' generated C code.