Work around strange status.is_error performance

name                             old speed     new speed     delta

wuffs_deflate_decode_1k/clang    138MB/s ± 0%  139MB/s ± 0%    ~     (p=0.222 n=5+5)
wuffs_deflate_decode_10k/clang   220MB/s ± 0%  220MB/s ± 0%    ~     (p=0.690 n=5+5)
wuffs_deflate_decode_100k/clang  258MB/s ± 0%  258MB/s ± 0%    ~     (p=0.548 n=5+5)

wuffs_deflate_decode_1k/gcc      156MB/s ± 1%  158MB/s ± 0%  +1.33%  (p=0.008 n=5+5)
wuffs_deflate_decode_10k/gcc     268MB/s ± 0%  267MB/s ± 0%  -0.68%  (p=0.008 n=5+5)
wuffs_deflate_decode_100k/gcc    312MB/s ± 0%  314MB/s ± 0%  +0.66%  (p=0.008 n=5+5)

wuffs_gzip_decode_10k/clang      204MB/s ± 0%  204MB/s ± 0%  +0.26%  (p=0.016 n=5+4)
wuffs_gzip_decode_100k/clang     237MB/s ± 0%  237MB/s ± 1%    ~     (p=0.548 n=5+5)

wuffs_gzip_decode_10k/gcc        246MB/s ± 0%  255MB/s ± 1%  +3.48%  (p=0.008 n=5+5)
wuffs_gzip_decode_100k/gcc       292MB/s ± 0%  293MB/s ± 0%  +0.36%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/clang      201MB/s ± 0%  201MB/s ± 1%    ~     (p=0.222 n=5+5)
wuffs_zlib_decode_100k/clang     233MB/s ± 0%  233MB/s ± 0%  +0.32%  (p=0.008 n=5+5)

wuffs_zlib_decode_10k/gcc        235MB/s ± 1%  254MB/s ± 0%  +8.03%  (p=0.008 n=5+5)
wuffs_zlib_decode_100k/gcc       270MB/s ± 0%  293MB/s ± 0%  +8.33%  (p=0.016 n=4+5)
This commit is contained in:
Nigel Tao committed 2018-12-29 14:08:13 +11:00
1 parent 093268e179
commit 3bf9573653
2 files changed
+12 -3

No files matched your search

+8 -2
View File
@@ -5507,9 +5507,15 @@ wuffs_deflate__decoder__decode_blocks(wuffs_deflate__decoder* self,
goto label_0_continue;
} else if (v_type == 1) {
v_status = wuffs_deflate__decoder__init_fixed_huffman(self);
if (wuffs_base__status__is_error(v_status)) {
if (!wuffs_base__status__is_ok(v_status)) {
status = v_status;
goto exit;
if (wuffs_base__status__is_error(status)) {
goto exit;
} else if (wuffs_base__status__is_suspension(status)) {
status = wuffs_base__error__cannot_return_a_suspension;
goto exit;
}
goto ok;
}
} else if (v_type == 2) {
if (a_src.private_impl.buf) {
+4 -1
View File
@@ -202,7 +202,10 @@ pri func decoder.decode_blocks?(dst base.io_writer, src base.io_reader) {
continue
} else if type == 1 {
status = this.init_fixed_huffman!()
if status.is_error() {
// TODO: "if status.is_error()" is probably more idiomatic, but for
// some mysterious, idiosyncratic reason, performs noticably worse
// for gcc (but not for clang).
if not status.is_ok() {
return status
}
} else if type == 2 {