mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-22 16:47:28 +01:00
Tweak std/deflate decode_huffman_fast asserts
wuffs_deflate_decode_1k_full_init/clang9 95.0MB/s ± 0% 92.9MB/s ± 0% -2.25% (p=0.008 n=5+5) wuffs_deflate_decode_1k_part_init/clang9 108MB/s ± 0% 108MB/s ± 0% +0.34% (p=0.008 n=5+5) wuffs_deflate_decode_10k_full_init/clang9 141MB/s ± 0% 165MB/s ± 1% +16.77% (p=0.008 n=5+5) wuffs_deflate_decode_10k_part_init/clang9 143MB/s ± 0% 169MB/s ± 0% +17.73% (p=0.008 n=5+5) wuffs_deflate_decode_100k_just_one_read/clang9 185MB/s ± 0% 181MB/s ± 0% -2.09% (p=0.008 n=5+5) wuffs_deflate_decode_100k_many_big_reads/clang9 156MB/s ± 1% 151MB/s ± 0% -3.12% (p=0.008 n=5+5) wuffs_deflate_decode_1k_full_init/gcc10 98.6MB/s ± 0% 97.5MB/s ± 0% -1.05% (p=0.016 n=4+5) wuffs_deflate_decode_1k_part_init/gcc10 112MB/s ± 0% 111MB/s ± 0% -1.05% (p=0.008 n=5+5) wuffs_deflate_decode_10k_full_init/gcc10 183MB/s ± 0% 181MB/s ± 1% -0.73% (p=0.008 n=5+5) wuffs_deflate_decode_10k_part_init/gcc10 186MB/s ± 0% 185MB/s ± 0% -0.80% (p=0.008 n=5+5) wuffs_deflate_decode_100k_just_one_read/gcc10 213MB/s ± 0% 216MB/s ± 0% +1.55% (p=0.008 n=5+5) wuffs_deflate_decode_100k_many_big_reads/gcc10 174MB/s ± 0% 179MB/s ± 0% +2.79% (p=0.008 n=5+5)
This commit is contained in:
1 parent
dc60821826
commit
4848859f97
3 files changed
+18
-15
No files matched your search
@@ -1210,17 +1210,17 @@ func (q *checker) canUndoByte(recv *a.Expr) error {
|
||||
|
||||
func (q *checker) canLimitedCopyU32FromHistoryFast(recv *a.Expr, args []*a.Node) error {
|
||||
// As per cgen's io-private.h, there are three pre-conditions:
|
||||
// - n <= this.length()
|
||||
// - upTo <= this.length()
|
||||
// - distance > 0
|
||||
// - distance <= this.history_length()
|
||||
|
||||
if len(args) != 2 {
|
||||
return fmt.Errorf("check: internal error: inconsistent copy_n_from_history_fast arguments")
|
||||
return fmt.Errorf("check: internal error: inconsistent limited_copy_u32_from_history_fast arguments")
|
||||
}
|
||||
n := args[0].AsArg().Value()
|
||||
upTo := args[0].AsArg().Value()
|
||||
distance := args[1].AsArg().Value()
|
||||
|
||||
// Check "n <= this.length()".
|
||||
// Check "upTo <= this.length()".
|
||||
check0:
|
||||
for {
|
||||
for _, x := range q.facts {
|
||||
@@ -1228,13 +1228,13 @@ check0:
|
||||
continue
|
||||
}
|
||||
|
||||
// Check that the LHS is "n as base.u64".
|
||||
// Check that the LHS is "upTo as base.u64".
|
||||
lhs := x.LHS().AsExpr()
|
||||
if lhs.Operator() != t.IDXBinaryAs {
|
||||
continue
|
||||
}
|
||||
llhs, lrhs := lhs.LHS().AsExpr(), lhs.RHS().AsTypeExpr()
|
||||
if !llhs.Eq(n) || !lrhs.Eq(typeExprU64) {
|
||||
if !llhs.Eq(upTo) || !lrhs.Eq(typeExprU64) {
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -1249,7 +1249,7 @@ check0:
|
||||
|
||||
break check0
|
||||
}
|
||||
return fmt.Errorf("check: could not prove n <= %s.length()", recv.Str(q.tm))
|
||||
return fmt.Errorf("check: could not prove (up_to as base.u64) <= %s.length()", recv.Str(q.tm))
|
||||
}
|
||||
|
||||
// Check "distance > 0".
|
||||
|
||||
Reference in new issue
Block a user