From c3a07db892d48f2f965732f506951dc8e393f01a Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 12 Jan 2019 13:31:17 +1100 Subject: [PATCH] Add wuffs_gif_decode_20k benchmark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit That GIF image's LZW-compressed data is the same as that used for the wuffs_lzw_decode_20k benchmark. Comparing the two speeds gives some indication of the relative overhead of the framing format, as well as decoding to a richer data structure (2D table instead of a 1D array, potentially to BGRA instead of palette-index, amongst other things). name speed wuffs_gif_decode_20k/clang 246MB/s ± 1% wuffs_gif_decode_20k/gcc 234MB/s ± 1% wuffs_lzw_decode_20k/clang 272MB/s ± 0% wuffs_lzw_decode_20k/gcc 269MB/s ± 0% --- test/c/std/gif.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test/c/std/gif.c b/test/c/std/gif.c index e9fca2d4..399175b5 100644 --- a/test/c/std/gif.c +++ b/test/c/std/gif.c @@ -1422,6 +1422,13 @@ const char* bench_wuffs_gif_decode_10k_indexed() { 100); } +const char* bench_wuffs_gif_decode_20k() { + CHECK_FOCUS(__func__); + return do_bench_gif_decode(wuffs_gif_decode, "test/data/bricks-gray.gif", + WUFFS_BASE__PIXEL_FORMAT__INDEXED__BGRA_BINARY, + 50); +} + const char* bench_wuffs_gif_decode_100k_artificial() { CHECK_FOCUS(__func__); return do_bench_gif_decode( @@ -1474,6 +1481,13 @@ const char* bench_mimic_gif_decode_10k_indexed() { 100); } +const char* bench_mimic_gif_decode_20k() { + CHECK_FOCUS(__func__); + return do_bench_gif_decode(mimic_gif_decode, "test/data/bricks-gray.gif", + WUFFS_BASE__PIXEL_FORMAT__INDEXED__BGRA_BINARY, + 50); +} + const char* bench_mimic_gif_decode_100k_artificial() { CHECK_FOCUS(__func__); return do_bench_gif_decode( @@ -1567,6 +1581,7 @@ proc benches[] = { bench_wuffs_gif_decode_1k_color, // bench_wuffs_gif_decode_10k_bgra, // bench_wuffs_gif_decode_10k_indexed, // + bench_wuffs_gif_decode_20k, // bench_wuffs_gif_decode_100k_artificial, // bench_wuffs_gif_decode_100k_realistic, // bench_wuffs_gif_decode_1000k, // @@ -1577,6 +1592,7 @@ proc benches[] = { bench_mimic_gif_decode_1k_bw, // bench_mimic_gif_decode_1k_color, // bench_mimic_gif_decode_10k_indexed, // + bench_mimic_gif_decode_20k, // bench_mimic_gif_decode_100k_artificial, // bench_mimic_gif_decode_100k_realistic, // bench_mimic_gif_decode_1000k, //