Update GIF frame_dirty_rect more frequently

It's not an optimization per se, but for the record:

name                                    old speed     new speed     delta

wuffs_gif_decode_1k_bw/clang            260MB/s ± 1%  261MB/s ± 0%  +0.51%  (p=0.032 n=5+5)
wuffs_gif_decode_1k_color/clang         122MB/s ± 0%  123MB/s ± 1%    ~     (p=0.222 n=5+5)
wuffs_gif_decode_10k/clang              148MB/s ± 1%  148MB/s ± 0%    ~     (p=0.421 n=5+5)
wuffs_gif_decode_100k_artificial/clang  439MB/s ± 0%  443MB/s ± 1%  +0.99%  (p=0.008 n=5+5)
wuffs_gif_decode_100k_realistic/clang   174MB/s ± 1%  173MB/s ± 1%    ~     (p=0.151 n=5+5)
wuffs_gif_decode_1000k/clang            175MB/s ± 0%  175MB/s ± 0%  -0.30%  (p=0.016 n=4+5)
wuffs_gif_decode_anim_screencap/clang   941MB/s ± 1%  948MB/s ± 0%  +0.74%  (p=0.016 n=5+5)

wuffs_gif_decode_1k_bw/gcc              266MB/s ± 0%  273MB/s ± 0%  +2.60%  (p=0.008 n=5+5)
wuffs_gif_decode_1k_color/gcc           137MB/s ± 0%  139MB/s ± 0%  +1.54%  (p=0.008 n=5+5)
wuffs_gif_decode_10k/gcc                163MB/s ± 0%  162MB/s ± 0%    ~     (p=0.151 n=5+5)
wuffs_gif_decode_100k_artificial/gcc    457MB/s ± 0%  456MB/s ± 0%    ~     (p=0.095 n=5+5)
wuffs_gif_decode_100k_realistic/gcc     184MB/s ± 0%  182MB/s ± 0%  -1.02%  (p=0.008 n=5+5)
wuffs_gif_decode_1000k/gcc              186MB/s ± 0%  184MB/s ± 0%  -1.04%  (p=0.016 n=5+4)
wuffs_gif_decode_anim_screencap/gcc     985MB/s ± 1%  980MB/s ± 0%    ~     (p=0.095 n=5+5)
This commit is contained in:
Nigel Tao committed 2018-11-24 10:17:16 +11:00
1 parent e84a716313
commit 8ab2a33aae
3 files changed
+46 -28

No files matched your search

+15 -7
View File
@@ -606,6 +606,11 @@ pri func decoder.decode_id_part1!??(dst ptr base.pixel_buffer, src base.io_reade
this.previous_lzw_decode_ended_abruptly = true
while true {
if args.src.available() == 0 {
if this.uncompressed_ri != this.uncompressed_wi {
this.copy_to_image_buffer!??(pb:args.dst)
}
}
var block_size base.u64 = args.src.read_u8!??() as base.u64
if block_size == 0 {
break
@@ -629,18 +634,21 @@ pri func decoder.decode_id_part1!??(dst ptr base.pixel_buffer, src base.io_reade
block_size ~sat-= args.src.since_mark().length()
}
if z.is_ok() or (z == status "$short write") {
this.copy_to_image_buffer!??(pb:args.dst)
if (block_size == 0) and (z == status "$short read") {
break:inner
}
if z == status "$short write" {
continue:inner
}
if this.uncompressed_ri != this.uncompressed_wi {
this.copy_to_image_buffer!??(pb:args.dst)
}
if z.is_ok() {
// TODO: check that block_size is zero?
this.previous_lzw_decode_ended_abruptly = false
break:inner
}
if (block_size == 0) and (z == status "$short read") {
break:inner
if z == status "$short write" {
continue:inner
}
yield z
}