Make deflate's decode_huffman_fast ! not !?

name                             old speed     new speed     delta

wuffs_deflate_decode_1k/clang    138MB/s ± 0%  139MB/s ± 0%  +0.75%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k/clang   233MB/s ± 0%  226MB/s ± 0%  -2.83%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k/clang  273MB/s ± 0%  259MB/s ± 1%  -5.20%  (p=0.008 n=5+5)

wuffs_deflate_decode_1k/gcc      158MB/s ± 1%  157MB/s ± 0%    ~     (p=0.151 n=5+5)
wuffs_deflate_decode_10k/gcc     266MB/s ± 1%  261MB/s ± 0%  -1.95%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k/gcc    314MB/s ± 0%  316MB/s ± 0%  +0.48%  (p=0.032 n=5+5)
This commit is contained in:
Nigel Tao committed 2018-12-28 18:59:30 +11:00
1 parent 7748216b57
commit a80962d502
6 files changed
+75 -27

No files matched your search

+8 -4
View File
@@ -179,9 +179,10 @@ pub func decoder.decode!??(dst base.io_writer, src base.io_reader) {
}
pri func decoder.decode_blocks!??(dst base.io_writer, src base.io_reader) {
var final base.u32
var b0 base.u32[..255]
var type base.u32
var final base.u32
var b0 base.u32[..255]
var type base.u32
var status base.status
while final == 0 {
while this.n_bits < 3,
@@ -208,7 +209,10 @@ pri func decoder.decode_blocks!??(dst base.io_writer, src base.io_reader) {
}
this.end_of_block = false
this.decode_huffman_fast!?(dst:args.dst, src:args.src)
status = this.decode_huffman_fast!(dst:args.dst, src:args.src)
if status.is_error() {
return status
}
if this.end_of_block {
continue
}
+1 -1
View File
@@ -14,7 +14,7 @@
// TODO: describe how the xxx_fast version differs from the xxx_slow one, the
// assumptions that xxx_fast makes, and how that makes it fast.
pri func decoder.decode_huffman_fast!?(dst base.io_writer, src base.io_reader) {
pri func decoder.decode_huffman_fast!(dst base.io_writer, src base.io_reader) base.status {
// When editing this function, consider making the equivalent change to the
// decode_huffman_slow function. Keep the diff between the two
// decode_huffman_*.wuffs files as small as possible, while retaining both