mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 08:47:56 +01:00
Optimize deflate Huffman; tighten an if
name old speed new speed delta wuffs_deflate_decode_1k/clang 148MB/s ± 0% 149MB/s ± 0% +0.61% (p=0.008 n=5+5) wuffs_deflate_decode_10k/clang 228MB/s ± 1% 235MB/s ± 0% +3.45% (p=0.016 n=5+4) wuffs_deflate_decode_100k/clang 253MB/s ± 0% 262MB/s ± 0% +3.42% (p=0.008 n=5+5) wuffs_deflate_decode_1k/gcc 158MB/s ± 1% 157MB/s ± 0% -0.44% (p=0.032 n=5+5) wuffs_deflate_decode_10k/gcc 265MB/s ± 0% 274MB/s ± 0% +3.31% (p=0.008 n=5+5) wuffs_deflate_decode_100k/gcc 300MB/s ± 0% 317MB/s ± 0% +5.45% (p=0.008 n=5+5)
This commit is contained in:
1 parent
0181537d0d
commit
34049e52d8
4 files changed
+35
-5
No files matched your search
@@ -138,6 +138,18 @@ var reasons = [...]struct {
|
||||
return nil
|
||||
}},
|
||||
|
||||
{`"a > b: b < a"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, xb := parseBinaryOp(n.Condition())
|
||||
if op != t.IDXBinaryGreaterThan {
|
||||
return errFailed
|
||||
}
|
||||
// b < a
|
||||
if err := proveReasonRequirement(q, t.IDXBinaryLessThan, xb, xa); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}},
|
||||
|
||||
{`"a <= b: b >= a"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, xb := parseBinaryOp(n.Condition())
|
||||
if op != t.IDXBinaryLessEq {
|
||||
@@ -210,6 +222,18 @@ var reasons = [...]struct {
|
||||
return nil
|
||||
}},
|
||||
|
||||
{`"a >= b: b <= a"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, xb := parseBinaryOp(n.Condition())
|
||||
if op != t.IDXBinaryGreaterEq {
|
||||
return errFailed
|
||||
}
|
||||
// b <= a
|
||||
if err := proveReasonRequirement(q, t.IDXBinaryLessEq, xb, xa); err != nil {
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
}},
|
||||
|
||||
{`"a < (b + c): a < c; 0 <= b"`, func(q *checker, n *a.Assert) error {
|
||||
op, xa, t0 := parseBinaryOp(n.Condition())
|
||||
if op != t.IDXBinaryLessThan {
|
||||
|
||||
@@ -37,11 +37,15 @@ var reasons = [...]string{
|
||||
"a < b: a < c; c <= b",
|
||||
"a < b: a <= c; c < b",
|
||||
|
||||
"a > b: b < a",
|
||||
|
||||
"a <= b: b >= a",
|
||||
"a <= b: a <= c; c <= b",
|
||||
"a <= b: a <= c; c == b",
|
||||
"a <= b: a == c; c <= b",
|
||||
|
||||
"a >= b: b <= a",
|
||||
|
||||
"a < (b + c): a < c; 0 <= b",
|
||||
"a < (b + c): a < (b0 + c0); b0 <= b; c0 <= c",
|
||||
|
||||
|
||||
Reference in new issue
Block a user