mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-24 16:52:18 +01:00
Tweak the copy_from_history32 unroll count.
name old speed new speed delta puffs_adler32_10k/clang 2.42GB/s ± 1% 2.43GB/s ± 1% ~ (p=0.720 n=10+9) puffs_adler32_100k/clang 2.43GB/s ± 0% 2.42GB/s ± 1% -0.41% (p=0.004 n=8+10) puffs_flate_decode_1k/clang 138MB/s ± 1% 139MB/s ± 1% +1.20% (p=0.000 n=10+10) puffs_flate_decode_10k/clang 189MB/s ± 1% 187MB/s ± 1% -1.27% (p=0.000 n=9+9) puffs_flate_decode_100k/clang 211MB/s ± 1% 210MB/s ± 1% -0.72% (p=0.001 n=10+9) puffs_zlib_decode_10k/clang 175MB/s ± 1% 173MB/s ± 1% -1.23% (p=0.000 n=10+10) puffs_zlib_decode_100k/clang 194MB/s ± 1% 193MB/s ± 0% -0.50% (p=0.018 n=10+9) puffs_adler32_10k/gcc 3.26GB/s ± 0% 3.22GB/s ± 1% -1.00% (p=0.000 n=9+10) puffs_adler32_100k/gcc 3.27GB/s ± 0% 3.23GB/s ± 1% -1.05% (p=0.000 n=8+9) puffs_flate_decode_1k/gcc 139MB/s ± 0% 141MB/s ± 1% +1.27% (p=0.000 n=9+10) puffs_flate_decode_10k/gcc 203MB/s ± 0% 231MB/s ± 0% +13.87% (p=0.000 n=10+9) puffs_flate_decode_100k/gcc 229MB/s ± 0% 258MB/s ± 0% +12.63% (p=0.000 n=9+9) puffs_zlib_decode_10k/gcc 201MB/s ± 0% 215MB/s ± 1% +6.86% (p=0.000 n=10+9) puffs_zlib_decode_100k/gcc 224MB/s ± 0% 239MB/s ± 0% +6.89% (p=0.000 n=9+9)
This commit is contained in:
1 parent
7ccb9234a4
commit
39952faca1
4 files changed
+32
-25
No files matched your search
+9
-7
@@ -535,13 +535,15 @@ static inline uint32_t puffs_base__writer1__copy_from_history32(
|
||||
} else {
|
||||
n = length;
|
||||
}
|
||||
// TODO: is manual unrolling actually helpful?
|
||||
for (; n >= 8; n -= 8) {
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
// TODO: unrolling by 3 seems best for the std/flate benchmarks, but that is
|
||||
// mostly because 3 is the minimum length for the flate format. This function
|
||||
// implementation shouldn't overfit to that one format. Perhaps the
|
||||
// copy_from_history32 Puffs method should also take an unroll hint argument,
|
||||
// and the cgen can look if that argument is the constant expression '3'.
|
||||
//
|
||||
// Alternatively, or additionally, have a sloppy_copy_from_history32 method
|
||||
// that copies 8 bytes at a time, possibly writing more than length bytes?
|
||||
for (; n >= 3; n -= 3) {
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
|
||||
+9
-7
@@ -479,13 +479,15 @@ static inline uint32_t puffs_base__writer1__copy_from_history32(
|
||||
} else {
|
||||
n = length;
|
||||
}
|
||||
// TODO: is manual unrolling actually helpful?
|
||||
for (; n >= 8; n -= 8) {
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
// TODO: unrolling by 3 seems best for the std/flate benchmarks, but that is
|
||||
// mostly because 3 is the minimum length for the flate format. This function
|
||||
// implementation shouldn't overfit to that one format. Perhaps the
|
||||
// copy_from_history32 Puffs method should also take an unroll hint argument,
|
||||
// and the cgen can look if that argument is the constant expression '3'.
|
||||
//
|
||||
// Alternatively, or additionally, have a sloppy_copy_from_history32 method
|
||||
// that copies 8 bytes at a time, possibly writing more than length bytes?
|
||||
for (; n >= 3; n -= 3) {
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
*ptr++ = *start++;
|
||||
|
||||
Reference in new issue
Block a user