Extend std/deflate ringbuffer to simplify copies

name                                             old speed     new speed     delta

wuffs_deflate_decode_1k_full_init/clang5         155MB/s ± 1%  154MB/s ± 0%   -0.98%  (p=0.000 n=10+9)
wuffs_deflate_decode_1k_part_init/clang5         190MB/s ± 0%  193MB/s ± 1%   +1.49%  (p=0.000 n=10+9)
wuffs_deflate_decode_10k_full_init/clang5        240MB/s ± 0%  249MB/s ± 0%   +3.68%  (p=0.000 n=9+10)
wuffs_deflate_decode_10k_part_init/clang5        247MB/s ± 0%  257MB/s ± 1%   +4.03%  (p=0.000 n=10+10)
wuffs_deflate_decode_100k_just_one_read/clang5   292MB/s ± 1%  291MB/s ± 0%   -0.34%  (p=0.043 n=10+9)
wuffs_deflate_decode_100k_many_big_reads/clang5  246MB/s ± 0%  250MB/s ± 0%   +1.77%  (p=0.000 n=9+10)

wuffs_deflate_decode_1k_full_init/gcc9           166MB/s ± 1%  165MB/s ± 1%   -0.48%  (p=0.009 n=10+10)
wuffs_deflate_decode_1k_part_init/gcc9           208MB/s ± 1%  212MB/s ± 0%   +1.85%  (p=0.000 n=10+9)
wuffs_deflate_decode_10k_full_init/gcc9          248MB/s ± 1%  281MB/s ± 0%  +13.05%  (p=0.000 n=9+10)
wuffs_deflate_decode_10k_part_init/gcc9          256MB/s ± 0%  290MB/s ± 0%  +13.34%  (p=0.000 n=10+10)
wuffs_deflate_decode_100k_just_one_read/gcc9     336MB/s ± 0%  333MB/s ± 0%   -0.93%  (p=0.000 n=9+8)
wuffs_deflate_decode_100k_many_big_reads/gcc9    262MB/s ± 0%  280MB/s ± 1%   +6.99%  (p=0.000 n=9+10)
This commit is contained in:
Nigel Tao committed 2020-03-05 12:35:03 +11:00
1 parent 771d4f9d98
commit e65c861207
5 files changed
+80 -69

No files matched your search

+24
View File
@@ -424,6 +424,30 @@ do_test_wuffs_deflate_history(int i,
": decode: have \"%s\", want \"%s\"",
i, starting_history_index, have_z.repr, want_z);
}
// Check that head and the tail of the ringbuffer match.
if (wuffs_base__status__is_suspension(&have_z)) {
const size_t max_length_minus_1 = 257;
wuffs_base__io_buffer head = ((wuffs_base__io_buffer){
.data = ((wuffs_base__slice_u8){
.ptr = dec->private_data.f_history + 0,
.len = max_length_minus_1,
}),
});
head.meta.wi = max_length_minus_1;
wuffs_base__io_buffer tail = ((wuffs_base__io_buffer){
.data = ((wuffs_base__slice_u8){
.ptr = dec->private_data.f_history + 0x8000,
.len = max_length_minus_1,
}),
});
tail.meta.wi = max_length_minus_1;
CHECK_STRING(check_io_buffers_equal("head vs tail ", &head, &tail));
}
return NULL;
}