Commit Graph
73 Commits
Author SHA1 Message Date
Nigel Tao dd94ad3821 Rename z variable to status, in C code 2018-12-28 16:14:03 +11:00
Nigel Tao 3e70383c6c Remove some if's from deflate.decode_huffman_fast
name                             old speed     new speed     delta

wuffs_deflate_decode_1k/clang    145MB/s ± 0%  151MB/s ± 1%  +4.54%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k/clang   234MB/s ± 0%  230MB/s ± 0%  -1.75%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k/clang  263MB/s ± 0%  276MB/s ± 1%  +5.17%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k/gcc      157MB/s ± 1%  157MB/s ± 0%    ~     (p=0.421 n=5+5)
wuffs_deflate_decode_10k/gcc     265MB/s ± 0%  259MB/s ± 0%  -2.16%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k/gcc    313MB/s ± 0%  315MB/s ± 0%  +0.39%  (p=0.016 n=5+5)

wuffs_gzip_decode_10k/clang      216MB/s ± 0%  212MB/s ± 0%  -1.69%  (p=0.016 n=5+4)
wuffs_gzip_decode_100k/clang     241MB/s ± 0%  252MB/s ± 0%  +4.67%  (p=0.016 n=5+4)

wuffs_gzip_decode_10k/gcc        251MB/s ± 1%  248MB/s ± 1%  -1.05%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc       285MB/s ± 1%  291MB/s ± 0%  +2.16%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/clang      213MB/s ± 0%  210MB/s ± 0%  -1.18%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/clang     239MB/s ± 0%  247MB/s ± 0%  +3.08%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc        244MB/s ± 0%  247MB/s ± 0%  +1.15%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc       282MB/s ± 0%  291MB/s ± 0%  +2.90%  (p=0.008 n=5+5)
2018-12-01 10:26:09 +11:00
Nigel Tao 03b046d774 Add script/print-crc32-example.go 2018-11-17 08:29:48 +11:00
Nigel Tao 34fe051cac Add commentary about the CRC-32 implementation 2018-11-11 10:25:19 +11:00
Nigel Tao 48c7d1c030 Add script/crawl.go 2018-11-04 20:38:04 +11:00
Nigel Tao b0c72867e6 Update std/lzw/README.md for algorithmic detail 2018-10-21 16:03:47 +11:00
Nigel Tao 8d7bd36179 Add more GIF benchmarks
The existing benchmarks decoded realistic photos. The new benchmarks
also decode artificially generated images, which compress better.

Also adjust script/extract-giflzw.go to optionally analyze and print a
histogram of LZW code emission lengths. "Compresses better" is highly
correlated with "a lower proportion of literal (1 length) codes".
2018-10-21 11:46:37 +11:00
Nigel Tao 7be9c39283 Move num_loops out of the image_config
For the GIF format, it isn't necessarily before the first frame.
2018-10-13 17:00:45 +11:00
Nigel Tao b68830e292 Add a MASK macro, for hand-written C 2018-10-13 11:43:02 +11:00
Nigel Tao ecd7152581 Fix a comment typo from the previous commit 2018-10-13 11:33:47 +11:00
Nigel Tao 99597e1ff1 Raise the N in crc32's slicing-by-N from 8 to 16
name                          old speed      new speed      delta
wuffs_crc32_ieee_10k/clang    2.35GB/s ± 0%  2.86GB/s ± 1%  +21.45%  (p=0.000 n=47+5)
wuffs_crc32_ieee_100k/clang   2.35GB/s ± 0%  2.86GB/s ± 2%  +21.84%  (p=0.000 n=48+5)
wuffs_crc32_ieee_10k/gcc      2.69GB/s ± 0%  3.36GB/s ± 1%  +25.10%  (p=0.000 n=47+5)
wuffs_crc32_ieee_100k/gcc     2.68GB/s ± 1%  3.39GB/s ± 0%  +26.39%  (p=0.000 n=44+5)
wuffs_gzip_decode_10k/clang    213MB/s ± 0%   215MB/s ± 0%   +0.95%  (p=0.000 n=46+5)
wuffs_gzip_decode_100k/clang   237MB/s ± 0%   240MB/s ± 0%   +1.31%  (p=0.000 n=48+5)
wuffs_gzip_decode_10k/gcc      241MB/s ± 1%   246MB/s ± 0%   +2.00%  (p=0.000 n=45+5)
wuffs_gzip_decode_100k/gcc     283MB/s ± 1%   290MB/s ± 0%   +2.25%  (p=0.000 n=48+5)
2018-10-07 21:01:18 +11:00
Nigel Tao 07151f88ce Copy Huffman optimizations, for hand-written C 2018-10-07 18:24:53 +11:00
Nigel Tao d1758d7a1c Update wuffs-deflate-decoder-decode-huffman.c 2018-09-15 15:05:43 +10:00
Nigel Tao 0c18c064b8 Update wuffs-deflate-decoder-decode-huffman.c 2018-08-26 12:47:44 +10:00
Nigel Tao 7c2993f786 Update wuffs-deflate-decoder-decode-huffman.c 2018-08-04 15:43:09 +10:00
Jimmy Casey 3c50ada2c6 Fixed Spelling. 2018-07-26 17:12:19 +00:00
Nigel Tao bc82e51371 Rename wuffs-unsupported-snapshot.h 2018-07-21 09:20:10 +10:00
Nigel Tao a0bafff465 Ship as a "single file C library" 2018-07-14 08:59:36 +10:00
Nigel Tao fdb7d7f174 Add !! to the magic "C HEADER ENDS HERE" string 2018-06-16 09:04:34 +10:00
Nigel Tao 23a462d31d Move build-all.sh to the top dir; add comments 2018-06-16 08:38:29 +10:00
Nigel Tao 11858b9799 Fix std/gif benchmark for filename change 2018-06-16 08:03:43 +10:00
Nigel Tao 34cfc3f863 Have std/gif's palettes be BGRA, not RGB 2018-05-24 10:33:02 +10:00
Nigel Tao 981bf19ad8 Add test/data/artificial GIF data 2018-05-23 12:20:45 +10:00
Nigel Tao f1d3a6f521 Add script/build-all.sh 2018-05-11 15:18:59 +10:00
Nigel Tao a106e2a857 Fill in multiple std/crc32 tables 2018-05-03 13:14:12 +10:00
Nigel Tao 8827e222b1 Add wuffs_base__io_buffer__{reader,writer} funcs 2018-04-27 20:54:44 +10:00
Nigel Tao 035b138cb1 Spin out a std/adler32 package 2018-04-27 17:20:10 +10:00
Nigel Tao d2075ce913 Add script/bench-c-deflate-fragmentation.c 2018-04-25 15:26:29 +10:00
Nigel Tao 97aab37462 Rename buf1, reader1, etc to io_buffer, io_reader
Also remove the unused Buf1, Buf2 and Usize tokens.
2018-04-05 20:49:48 +10:00
Nigel Tao a2949fe28d Add Adler32 and CRC32/IEEE tests for pi's digits 2018-03-25 21:54:07 +11:00
Nigel Tao 3a7ccfe9b4 Implement crc32's ieee.update 2018-03-25 18:09:51 +11:00
Nigel Tao 0ebfb75699 Add crc32 ieee test cases 2018-03-25 17:20:31 +11:00
Nigel Tao 4675efdcc5 Fix deflate decode when the distance is 32768 2018-03-23 12:49:42 +11:00
Nigel Tao f11e1f97c6 Add deflate-distance-32768 test case 2018-03-21 12:32:51 +11:00
Nigel Tao d1399fac19 Rename test/testdata to test/data 2018-03-16 10:48:33 +11:00
Nigel Tao 39bc8688f6 Mask Huffman bits faster, for hand-written C
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.
2018-02-22 15:53:42 +11:00
Nigel Tao 68e972c551 Load Huffman bits faster, for hand-written C
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.
2018-02-22 15:12:08 +11:00
Nigel Tao 9a463d4675 Add some more Go and Rust GIF benchmarks
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.
2018-02-02 12:09:22 +11:00
Nigel Tao 5ebc62e7da Rename bench-gif-dot-rs to bench-rust-gif-dot-rs
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".
2018-02-02 09:46:43 +11:00
Nigel Tao bcc4450624 Rust style fixes 2018-01-31 16:50:38 +11:00
Nigel Tao d74b3a3e29 Add a benchmark for gif.rs, a Rust GIF library
On my machine:

gif.rs        24.7 MB/s  (rustc 1.21)
giflib        97.2 MB/s  (giflib 5.1)
wuffs/clang  118   MB/s  (clang 3.8)
wuffs/gcc    141   MB/s  (gcc 6.3)
2018-01-27 16:12:30 +11:00
Nigel Tao 44f5b2d384 Allow varying BUFFER_SIZE in adler32-standalone.c 2017-12-08 11:14:30 +11:00
Nigel Tao 36051062cb Update a script for the std/flate rename 2017-12-07 16:23:18 +11:00
Nigel Tao cb17fddfc2 script/adler32-standalone.c 2017-12-07 12:59:03 +11:00
Nigel Tao 802b9d8bfd Rename deflate-related scripts 2017-12-04 10:43:32 +11:00
Nigel Tao 024dc7f97a Rename PUFFS to WUFFS, part 11 of N 2017-11-30 18:18:40 +11:00
Nigel Tao 79a94558be Rename PUFFS to WUFFS, part 5 of N 2017-11-30 16:37:20 +11:00
Nigel Tao 456e620d02 Rename PUFFS to WUFFS, part 4 of N 2017-11-30 16:28:28 +11:00
Nigel Tao becd1a6b25 Fix a comment typo. 2017-11-08 16:56:22 +11:00
Nigel Tao 7ccb9234a4 Fix hand-written decode_huffman_fast C impl. 2017-11-08 10:12:47 +11:00