mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 16:47:28 +01:00
Unroll the std/crc32 loop
name old speed new speed delta wuffs_crc32_ieee_10k/clang 2.30GB/s ± 1% 2.37GB/s ± 0% +3.31% (p=0.016 n=5+4) wuffs_crc32_ieee_100k/clang 2.30GB/s ± 0% 2.35GB/s ± 0% +2.39% (p=0.008 n=5+5) wuffs_crc32_ieee_10k/gcc 2.49GB/s ± 1% 2.72GB/s ± 0% +9.19% (p=0.008 n=5+5) wuffs_crc32_ieee_100k/gcc 2.50GB/s ± 0% 2.70GB/s ± 1% +8.18% (p=0.008 n=5+5) wuffs_gzip_decode_10k/clang 206MB/s ± 2% 207MB/s ± 0% ~ (p=1.000 n=5+5) wuffs_gzip_decode_100k/clang 231MB/s ± 2% 235MB/s ± 0% +1.57% (p=0.008 n=5+5) wuffs_gzip_decode_10k/gcc 234MB/s ± 0% 235MB/s ± 1% ~ (p=0.095 n=5+5) wuffs_gzip_decode_100k/gcc 267MB/s ± 0% 266MB/s ± 2% ~ (p=0.690 n=5+5)
This commit is contained in:
1 parent
a23681d1ba
commit
58cd282138
3 files changed
+118
-4
No files matched your search
@@ -27,7 +27,7 @@ pub struct ieee_hasher?(
|
||||
pub func ieee_hasher.update(x slice base.u8)(checksum base.u32) {
|
||||
var s base.u32 = 0xFFFFFFFF ^ this.state
|
||||
|
||||
iterate (step:8, unroll:1)(p slice base.u8:in.x) {
|
||||
iterate (step:8, unroll:8)(p slice base.u8:in.x) {
|
||||
// TODO: explain the slicing-by-8 algorithm.
|
||||
s ^= ((p[0] as base.u32) << 0) |
|
||||
((p[1] as base.u32) << 8) |
|
||||
|
||||
Reference in new issue
Block a user