Optimize some more more std/gif if blocks

name                             old speed     new speed     delta

wuffs_lzw_decode_20k/clang       136MB/s ± 0%  134MB/s ± 1%  -1.27%  (p=0.000 n=9+9)
wuffs_lzw_decode_100k/clang      175MB/s ± 0%  175MB/s ± 0%    ~     (p=0.863 n=9+9)

wuffs_lzw_decode_20k/gcc         168MB/s ± 0%  177MB/s ± 1%  +5.79%  (p=0.000 n=9+8)
wuffs_lzw_decode_100k/gcc        242MB/s ± 0%  262MB/s ± 3%  +8.27%  (p=0.000 n=10+10)

wuffs_gif_decode_1k_bw/clang     280MB/s ± 1%  294MB/s ± 1%  +4.88%  (p=0.000 n=9+9)
wuffs_gif_decode_1k_color/clang  158MB/s ± 0%  158MB/s ± 0%    ~     (p=0.724 n=8+9)
wuffs_gif_decode_10k/clang       146MB/s ± 0%  146MB/s ± 0%    ~     (p=0.387 n=9+9)
wuffs_gif_decode_100k/clang      125MB/s ± 0%  125MB/s ± 1%  +0.18%  (p=0.040 n=9+9)
wuffs_gif_decode_1000k/clang     128MB/s ± 0%  128MB/s ± 1%  +0.38%  (p=0.008 n=8+9)

wuffs_gif_decode_1k_bw/gcc       323MB/s ± 1%  306MB/s ± 2%  -5.20%  (p=0.000 n=10+10)
wuffs_gif_decode_1k_color/gcc    167MB/s ± 2%  164MB/s ± 1%  -1.71%  (p=0.002 n=10+10)
wuffs_gif_decode_10k/gcc         151MB/s ± 0%  152MB/s ± 0%  +0.67%  (p=0.000 n=9+10)
wuffs_gif_decode_100k/gcc        134MB/s ± 0%  136MB/s ± 1%  +1.16%  (p=0.001 n=9+9)
wuffs_gif_decode_1000k/gcc       138MB/s ± 0%  140MB/s ± 1%  +1.18%  (p=0.000 n=9+9)
This commit is contained in:
Nigel Tao committed 2018-06-30 08:49:23 +10:00
1 parent 9cd37adfe8
commit 92b566367d
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -2200,8 +2200,8 @@ wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
if ((v_save_code == (((uint32_t)(1)) << v_width)) && (v_width < 12)) {
v_width += 1;
}
v_prev_code = v_code;
}
v_prev_code = v_code;
} else if (v_code <= v_end_code) {
if (v_code == v_end_code) {
status = WUFFS_BASE__STATUS_OK;
@@ -2253,8 +2253,8 @@ wuffs_base__status wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
if ((v_save_code == (((uint32_t)(1)) << v_width)) && (v_width < 12)) {
v_width += 1;
}
v_prev_code = v_code;
}
v_prev_code = v_code;
} else {
status = WUFFS_LZW__ERROR_BAD_CODE;
goto exit;
+2 -2
View File
@@ -76,8 +76,8 @@ pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
if (save_code == ((1 as base.u32) << width)) and (width < 12) {
width += 1
}
prev_code = code
}
prev_code = code
} else if code <= end_code {
if code == end_code {
@@ -134,8 +134,8 @@ pub func decoder.decode?(dst base.io_writer, src base.io_reader)() {
if (save_code == ((1 as base.u32) << width)) and (width < 12) {
width += 1
}
prev_code = code
}
prev_code = code
} else {
return error "bad code"