Delete the obsolete lzw.decoder.suffixes array

This commit will soon be followed by a rollback, but it is committed
anyway so that we can refer to these numbers in the git log.

Avoiding the zero-initialization of the 32768-byte array avoids a fixed
cost, regardless of e.g. the size of the decoded GIF image. A fixed
absolute improvement is a bigger relative improvement for smaller GIFs.

Compared to the previous commit:

name                                     old speed      new speed      delta

wuffs_lzw_decode_20k/clang5               241MB/s ± 0%   247MB/s ± 0%   +2.71%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/clang5              401MB/s ± 1%   407MB/s ± 0%   +1.42%  (p=0.008 n=5+5)

wuffs_lzw_decode_20k/gcc7                 235MB/s ± 0%   238MB/s ± 1%   +1.21%  (p=0.008 n=5+5)
wuffs_lzw_decode_100k/gcc7                382MB/s ± 0%   384MB/s ± 0%     ~     (p=0.095 n=5+5)

wuffs_gif_decode_1k_bw/clang5             235MB/s ± 1%   318MB/s ± 0%  +35.34%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color/clang5          132MB/s ± 0%   154MB/s ± 0%  +16.47%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/clang5          678MB/s ± 0%   697MB/s ± 1%   +2.75%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/clang5       181MB/s ± 0%   186MB/s ± 0%   +2.65%  (p=0.008 n=5+5)
wuffs_gif_decode_20k/clang5               226MB/s ± 0%   226MB/s ± 1%     ~     (p=0.690 n=5+5)
wuffs_gif_decode_100k_artificial/clang5   506MB/s ± 0%   508MB/s ± 1%     ~     (p=0.222 n=5+5)
wuffs_gif_decode_100k_realistic/clang5    203MB/s ± 1%   203MB/s ± 0%     ~     (p=0.310 n=5+5)
wuffs_gif_decode_1000k/clang5             206MB/s ± 0%   206MB/s ± 0%   -0.26%  (p=0.032 n=5+5)
wuffs_gif_decode_anim_screencap/clang5   1.04GB/s ± 1%  1.03GB/s ± 0%     ~     (p=0.151 n=5+5)

wuffs_gif_decode_1k_bw/gcc7               255MB/s ± 1%   398MB/s ± 0%  +56.43%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color/gcc7            137MB/s ± 1%   161MB/s ± 0%  +17.63%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_bgra/gcc7            593MB/s ± 0%   604MB/s ± 1%   +1.83%  (p=0.008 n=5+5)
wuffs_gif_decode_10k_indexed/gcc7         182MB/s ± 2%   187MB/s ± 1%   +2.85%  (p=0.008 n=5+5)
wuffs_gif_decode_20k/gcc7                 226MB/s ± 0%   227MB/s ± 0%   +0.56%  (p=0.032 n=5+5)
wuffs_gif_decode_100k_artificial/gcc7     488MB/s ± 0%   492MB/s ± 0%   +0.80%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/gcc7      203MB/s ± 0%   201MB/s ± 0%   -1.29%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k/gcc7               207MB/s ± 0%   203MB/s ± 0%   -2.17%  (p=0.008 n=5+5)
wuffs_gif_decode_anim_screencap/gcc7     1.03GB/s ± 0%  1.04GB/s ± 0%   +0.67%  (p=0.008 n=5+5)
This commit is contained in:
Nigel Tao committed 2019-02-03 15:02:16 +11:00
1 parent f877fb2c59
commit 85be5b9f8a
2 files changed
-2

No files matched your search

-1
View File
@@ -2896,7 +2896,6 @@ struct wuffs_lzw__decoder__struct {
uint32_t f_output_ri; uint32_t f_output_ri;
uint32_t f_output_wi; uint32_t f_output_wi;
uint32_t f_read_from_return_value; uint32_t f_read_from_return_value;
uint8_t f_suffixes[32768];
uint16_t f_prefixes[4096]; uint16_t f_prefixes[4096];
uint16_t f_lm1s[4096]; uint16_t f_lm1s[4096];
uint8_t f_output[8199]; uint8_t f_output[8199];
-1
View File
@@ -46,7 +46,6 @@ pub struct decoder?(
read_from_return_value base.u32, read_from_return_value base.u32,
// read_from per-code state. // read_from per-code state.
suffixes array[4096 * 8] base.u8,
prefixes array[4096] base.u16[..4095], prefixes array[4096] base.u16[..4095],
// lm1s is the "length minus 1"s of the values for the implicit key-value // lm1s is the "length minus 1"s of the values for the implicit key-value
// table in this decoder. See std/lzw/README.md for more detail. // table in this decoder. See std/lzw/README.md for more detail.