mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-20 00:47:28 +01:00
Remove another obsolete bounds[0] check
Benchmarks are a little noisy, but they certainly don't look worse. I can't remember why that "if true" performance optimization hack was added in the first place, although my compiler versions have probably upgraded since that hack was added. name old speed new speed delta wuffs_deflate_decode_1k/clang 141MB/s ± 0% 141MB/s ± 2% ~ (p=0.151 n=5+5) wuffs_deflate_decode_10k/clang 210MB/s ± 0% 226MB/s ± 3% +7.68% (p=0.008 n=5+5) wuffs_deflate_decode_100k/clang 230MB/s ± 0% 251MB/s ± 4% +9.28% (p=0.008 n=5+5) wuffs_deflate_decode_1k/gcc 152MB/s ± 1% 151MB/s ± 2% ~ (p=0.841 n=5+5) wuffs_deflate_decode_10k/gcc 251MB/s ± 3% 263MB/s ± 3% +4.75% (p=0.008 n=5+5) wuffs_deflate_decode_100k/gcc 293MB/s ± 3% 302MB/s ± 0% +2.90% (p=0.008 n=5+5) wuffs_lzw_decode_20k/clang 126MB/s ± 0% 127MB/s ± 0% +0.48% (p=0.032 n=5+5) wuffs_lzw_decode_100k/clang 161MB/s ± 4% 163MB/s ± 0% ~ (p=0.151 n=5+5) wuffs_gif_decode_1k/clang 350MB/s ± 1% 354MB/s ± 1% ~ (p=0.056 n=5+5) wuffs_gif_decode_10k/clang 140MB/s ± 0% 140MB/s ± 2% ~ (p=0.841 n=5+5) wuffs_gif_decode_100k/clang 120MB/s ± 1% 121MB/s ± 0% +0.87% (p=0.016 n=5+5) wuffs_gif_decode_1000k/clang 122MB/s ± 2% 124MB/s ± 0% +1.47% (p=0.016 n=5+4) wuffs_lzw_decode_20k/gcc 146MB/s ± 1% 148MB/s ± 3% ~ (p=0.151 n=5+5) wuffs_lzw_decode_100k/gcc 201MB/s ± 3% 207MB/s ± 3% ~ (p=0.095 n=5+5) wuffs_gif_decode_1k/gcc 346MB/s ± 0% 346MB/s ± 1% ~ (p=0.548 n=5+5) wuffs_gif_decode_10k/gcc 125MB/s ± 0% 127MB/s ± 2% ~ (p=0.151 n=5+5) wuffs_gif_decode_100k/gcc 115MB/s ± 1% 117MB/s ± 1% +2.13% (p=0.008 n=5+5) wuffs_gif_decode_1000k/gcc 117MB/s ± 1% 119MB/s ± 0% +2.23% (p=0.016 n=5+4)
This commit is contained in:
1 parent
124a329e73
commit
8b25a3035a
4 files changed
+29
-63
No files matched your search
@@ -184,19 +184,10 @@ func (g *gen) writeExprOther(b *buffer, n *a.Expr, rp replacementPolicy, pp pare
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.IDSinceMark, 0) {
|
||||
// Write .len as either "foo ? bar : baz" or "bar".
|
||||
//
|
||||
// TODO: drop the "true" in the "if true", provided that the
|
||||
// benchmark numbers improve.
|
||||
len0, len1 := "", ""
|
||||
if true {
|
||||
len0 = aPrefix + "dst.private_impl.bounds[0] ?"
|
||||
len1 = ": 0"
|
||||
}
|
||||
b.printf("((wuffs_base__slice_u8){ "+
|
||||
".ptr = %sdst.private_impl.bounds[0], "+
|
||||
".len = %s (size_t)(%swptr_dst - %sdst.private_impl.bounds[0]) %s, })",
|
||||
aPrefix, len0, bPrefix, aPrefix, len1)
|
||||
".len = %swptr_dst - %sdst.private_impl.bounds[0], })",
|
||||
aPrefix, bPrefix, aPrefix)
|
||||
return nil
|
||||
}
|
||||
if isInDst(g.tm, n, t.IDCopyFromReader32, 2) {
|
||||
|
||||
Reference in new issue
Block a user