mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
Remove some suspensions from decode_huffman_fast.
name old speed new speed delta puffs_adler32_10k/clang 2.41GB/s ± 1% 2.39GB/s ± 2% -0.88% (p=0.022 n=9+10) puffs_adler32_100k/clang 2.41GB/s ± 1% 2.39GB/s ± 2% ~ (p=0.095 n=10+9) puffs_flate_decode_1k/clang 136MB/s ± 2% 134MB/s ± 1% -0.86% (p=0.036 n=9+8) puffs_flate_decode_10k/clang 172MB/s ± 0% 175MB/s ± 0% +1.96% (p=0.000 n=8+9) puffs_flate_decode_100k/clang 206MB/s ± 0% 209MB/s ± 1% +1.38% (p=0.000 n=8+9) puffs_zlib_decode_10k/clang 160MB/s ± 1% 163MB/s ± 2% +1.73% (p=0.001 n=9+9) puffs_zlib_decode_100k/clang 189MB/s ± 1% 188MB/s ± 6% ~ (p=0.143 n=10+10) puffs_adler32_10k/gcc 3.27GB/s ± 0% 3.20GB/s ± 2% -2.03% (p=0.000 n=8+10) puffs_adler32_100k/gcc 3.27GB/s ± 0% 3.21GB/s ± 1% -1.89% (p=0.000 n=8+10) puffs_flate_decode_1k/gcc 141MB/s ± 1% 139MB/s ± 1% -1.66% (p=0.000 n=9+10) puffs_flate_decode_10k/gcc 200MB/s ± 0% 209MB/s ± 1% +4.73% (p=0.000 n=10+10) puffs_flate_decode_100k/gcc 242MB/s ± 0% 237MB/s ± 0% -2.19% (p=0.000 n=9+10) puffs_zlib_decode_10k/gcc 188MB/s ± 0% 195MB/s ± 1% +3.71% (p=0.000 n=10+10) puffs_zlib_decode_100k/gcc 225MB/s ± 0% 221MB/s ± 0% -1.84% (p=0.000 n=8+9)
This commit is contained in:
1 parent
058938006a
commit
0bc6f792fb
5 files changed
+24
-92
No files matched your search
+1
-62
@@ -236,22 +236,6 @@ typedef struct {
|
||||
uint8_t v_rep_symbol;
|
||||
uint32_t v_rep_count;
|
||||
} c_init_dynamic_huffman[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_bits;
|
||||
uint32_t v_n_bits;
|
||||
uint32_t v_table_entry;
|
||||
uint32_t v_table_entry_n_bits;
|
||||
uint32_t v_lmask;
|
||||
uint32_t v_dmask;
|
||||
uint32_t v_redir_top;
|
||||
uint32_t v_redir_mask;
|
||||
uint32_t v_length;
|
||||
uint32_t v_distance;
|
||||
uint32_t v_n_copied;
|
||||
uint32_t v_hlen;
|
||||
uint32_t v_hdist;
|
||||
} c_decode_huffman_fast[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_bits;
|
||||
@@ -2029,27 +2013,7 @@ static puffs_flate__status puffs_flate__flate_decoder__decode_huffman_fast(
|
||||
b_rend_src = b_rptr_src + len;
|
||||
}
|
||||
|
||||
uint32_t coro_susp_point =
|
||||
self->private_impl.c_decode_huffman_fast[0].coro_susp_point;
|
||||
if (coro_susp_point) {
|
||||
v_bits = self->private_impl.c_decode_huffman_fast[0].v_bits;
|
||||
v_n_bits = self->private_impl.c_decode_huffman_fast[0].v_n_bits;
|
||||
v_table_entry = self->private_impl.c_decode_huffman_fast[0].v_table_entry;
|
||||
v_table_entry_n_bits =
|
||||
self->private_impl.c_decode_huffman_fast[0].v_table_entry_n_bits;
|
||||
v_lmask = self->private_impl.c_decode_huffman_fast[0].v_lmask;
|
||||
v_dmask = self->private_impl.c_decode_huffman_fast[0].v_dmask;
|
||||
v_redir_top = self->private_impl.c_decode_huffman_fast[0].v_redir_top;
|
||||
v_redir_mask = self->private_impl.c_decode_huffman_fast[0].v_redir_mask;
|
||||
v_length = self->private_impl.c_decode_huffman_fast[0].v_length;
|
||||
v_distance = self->private_impl.c_decode_huffman_fast[0].v_distance;
|
||||
v_n_copied = self->private_impl.c_decode_huffman_fast[0].v_n_copied;
|
||||
v_hlen = self->private_impl.c_decode_huffman_fast[0].v_hlen;
|
||||
v_hdist = self->private_impl.c_decode_huffman_fast[0].v_hdist;
|
||||
}
|
||||
switch (coro_susp_point) {
|
||||
PUFFS_BASE__COROUTINE_SUSPENSION_POINT_0;
|
||||
|
||||
{
|
||||
if (self->private_impl.f_n_bits >= 8) {
|
||||
status = PUFFS_FLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS;
|
||||
goto exit;
|
||||
@@ -2306,7 +2270,6 @@ static puffs_flate__status puffs_flate__flate_decoder__decode_huffman_fast(
|
||||
label_0_break:;
|
||||
while (v_n_bits >= 8) {
|
||||
v_n_bits -= 8;
|
||||
PUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
|
||||
if (b_rptr_src == b_rstart_src) {
|
||||
status = PUFFS_FLATE__ERROR_INVALID_I_O_OPERATION;
|
||||
goto exit;
|
||||
@@ -2319,31 +2282,7 @@ static puffs_flate__status puffs_flate__flate_decoder__decode_huffman_fast(
|
||||
status = PUFFS_FLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_N_BITS;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
goto ok;
|
||||
ok:
|
||||
self->private_impl.c_decode_huffman_fast[0].coro_susp_point = 0;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
goto suspend;
|
||||
suspend:
|
||||
self->private_impl.c_decode_huffman_fast[0].coro_susp_point = coro_susp_point;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_bits = v_bits;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_n_bits = v_n_bits;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_table_entry = v_table_entry;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_table_entry_n_bits =
|
||||
v_table_entry_n_bits;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_lmask = v_lmask;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_dmask = v_dmask;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_redir_top = v_redir_top;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_redir_mask = v_redir_mask;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_length = v_length;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_distance = v_distance;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_n_copied = v_n_copied;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_hlen = v_hlen;
|
||||
self->private_impl.c_decode_huffman_fast[0].v_hdist = v_hdist;
|
||||
|
||||
exit:
|
||||
if (a_dst.buf) {
|
||||
size_t n = b_wptr_dst - (a_dst.buf->ptr + a_dst.buf->wi);
|
||||
|
||||
@@ -236,22 +236,6 @@ typedef struct {
|
||||
uint8_t v_rep_symbol;
|
||||
uint32_t v_rep_count;
|
||||
} c_init_dynamic_huffman[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_bits;
|
||||
uint32_t v_n_bits;
|
||||
uint32_t v_table_entry;
|
||||
uint32_t v_table_entry_n_bits;
|
||||
uint32_t v_lmask;
|
||||
uint32_t v_dmask;
|
||||
uint32_t v_redir_top;
|
||||
uint32_t v_redir_mask;
|
||||
uint32_t v_length;
|
||||
uint32_t v_distance;
|
||||
uint32_t v_n_copied;
|
||||
uint32_t v_hlen;
|
||||
uint32_t v_hdist;
|
||||
} c_decode_huffman_fast[1];
|
||||
struct {
|
||||
uint32_t coro_susp_point;
|
||||
uint32_t v_bits;
|
||||
|
||||
Reference in new issue
Block a user