mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
Have std/lzw always rewind excess bits
I'm not sure of the underlying reason for the lzw/gcc benchmark anomaly
(the gif/gcc numbers don't change), but it's the same mystery as commit
ecb3995 `Tweak how std/lzw yields "short read"`.
name old speed new speed delta
wuffs_lzw_decode_20k/clang 223MB/s ± 0% 214MB/s ± 0% -3.96% (p=0.008 n=5+5)
wuffs_lzw_decode_100k/clang 385MB/s ± 0% 369MB/s ± 0% -4.15% (p=0.008 n=5+5)
wuffs_lzw_decode_20k/gcc 186MB/s ± 1% 232MB/s ± 1% +24.41% (p=0.008 n=5+5)
wuffs_lzw_decode_100k/gcc 224MB/s ± 1% 384MB/s ± 1% +71.81% (p=0.008 n=5+5)
wuffs_gif_decode_1k_bw/clang 238MB/s ± 1% 236MB/s ± 0% ~ (p=0.222 n=5+5)
wuffs_gif_decode_1k_color/clang 124MB/s ± 0% 118MB/s ± 1% -4.75% (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang 596MB/s ± 0% 562MB/s ± 0% -5.71% (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/clang 159MB/s ± 0% 149MB/s ± 0% -6.42% (p=0.008 n=5+5)
wuffs_gif_decode_100k_artificial/clang 492MB/s ± 1% 487MB/s ± 0% -0.98% (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang 192MB/s ± 0% 183MB/s ± 0% -5.07% (p=0.008 n=5+5)
wuffs_gif_decode_1000k/clang 195MB/s ± 0% 185MB/s ± 0% -4.93% (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/clang 1.01GB/s ± 1% 1.02GB/s ± 0% +1.25% (p=0.008 n=5+5)
wuffs_gif_decode_1k_bw/gcc 247MB/s ± 0% 250MB/s ± 0% +1.26% (p=0.008 n=5+5)
wuffs_gif_decode_1k_color/gcc 131MB/s ± 2% 133MB/s ± 0% ~ (p=0.151 n=5+5)
wuffs_gif_decode_10k_bgra/gcc 541MB/s ± 1% 543MB/s ± 1% ~ (p=0.548 n=5+5)
wuffs_gif_decode_10k_indexed/gcc 167MB/s ± 0% 167MB/s ± 1% ~ (p=0.730 n=4+5)
wuffs_gif_decode_100k_artificial/gcc 469MB/s ± 0% 465MB/s ± 1% -0.78% (p=0.016 n=4+5)
wuffs_gif_decode_100k_realistic/gcc 190MB/s ± 0% 190MB/s ± 0% -0.34% (p=0.032 n=4+5)
wuffs_gif_decode_1000k/gcc 193MB/s ± 1% 192MB/s ± 1% ~ (p=0.556 n=4+5)
wuffs_gif_decode_anim_screencap/gcc 995MB/s ± 1% 995MB/s ± 1% ~ (p=0.841 n=5+5)
This commit is contained in:
1 parent
0f27e97e28
commit
010df42d75
3 files changed
+78
-36
No files matched your search
@@ -7358,17 +7358,16 @@ wuffs_lzw__decoder__decode(wuffs_lzw__decoder* self,
|
||||
}
|
||||
}
|
||||
label_1_break:;
|
||||
if (v_j > 0) {
|
||||
while (v_n_bits >= 8) {
|
||||
v_n_bits -= 8;
|
||||
if (iop_a_src > io0_a_src) {
|
||||
(iop_a_src--, wuffs_base__return_empty_struct());
|
||||
} else {
|
||||
status = wuffs_lzw__error__internal_error_inconsistent_i_o;
|
||||
goto exit;
|
||||
}
|
||||
while (v_n_bits >= 8) {
|
||||
v_n_bits -= 8;
|
||||
if (iop_a_src > io0_a_src) {
|
||||
(iop_a_src--, wuffs_base__return_empty_struct());
|
||||
} else {
|
||||
status = wuffs_lzw__error__internal_error_inconsistent_i_o;
|
||||
goto exit;
|
||||
}
|
||||
v_bits = ((v_bits)&WUFFS_BASE__LOW_BITS_MASK__U32(v_n_bits));
|
||||
}
|
||||
if (v_j > 0) {
|
||||
self->private_impl.f_flush_j = v_j;
|
||||
WUFFS_BASE__COROUTINE_SUSPENSION_POINT(4);
|
||||
status = wuffs_lzw__decoder__auto_flush(self, a_dst);
|
||||
|
||||
Reference in new issue
Block a user