Use history_available in decode_huffman_fast

name                                             old speed     new speed     delta

wuffs_deflate_decode_1k_full_init/clang5         134MB/s ± 1%  137MB/s ± 0%  +1.74%  (p=0.000 n=10+10)
wuffs_deflate_decode_1k_part_init/clang5         162MB/s ± 1%  165MB/s ± 0%  +1.79%  (p=0.000 n=10+10)
wuffs_deflate_decode_10k_full_init/clang5        220MB/s ± 0%  226MB/s ± 0%  +2.76%  (p=0.000 n=10+9)
wuffs_deflate_decode_10k_part_init/clang5        225MB/s ± 0%  232MB/s ± 1%  +2.77%  (p=0.000 n=9+9)
wuffs_deflate_decode_100k_just_one_read/clang5   270MB/s ± 0%  265MB/s ± 0%  -1.93%  (p=0.000 n=10+10)
wuffs_deflate_decode_100k_many_big_reads/clang5  225MB/s ± 0%  223MB/s ± 0%  -1.04%  (p=0.000 n=10+9)

wuffs_deflate_decode_1k_full_init/gcc7           151MB/s ± 1%  151MB/s ± 0%    ~     (p=0.277 n=9+8)
wuffs_deflate_decode_1k_part_init/gcc7           186MB/s ± 1%  186MB/s ± 0%    ~     (p=0.696 n=10+8)
wuffs_deflate_decode_10k_full_init/gcc7          256MB/s ± 1%  253MB/s ± 1%  -0.98%  (p=0.001 n=10+9)
wuffs_deflate_decode_10k_part_init/gcc7          264MB/s ± 1%  261MB/s ± 0%  -1.11%  (p=0.000 n=10+9)
wuffs_deflate_decode_100k_just_one_read/gcc7     310MB/s ± 1%  312MB/s ± 0%  +0.43%  (p=0.013 n=10+9)
wuffs_deflate_decode_100k_many_big_reads/gcc7    247MB/s ± 0%  251MB/s ± 0%  +1.47%  (p=0.000 n=10+9)
This commit is contained in:
Nigel Tao committed 2019-07-06 11:31:17 +10:00
1 parent 9f7435c7b4
commit b54b40a418
3 files changed
+16 -20

No files matched your search

+7 -11
View File
@@ -1113,10 +1113,10 @@ func (q *checker) canUndoByte(recv *a.Expr) error {
}
func (q *checker) canCopyNFromHistoryFast(recv *a.Expr, args []*a.Node) error {
// As per cgen's base-private.h, there are three pre-conditions:
// As per cgen's io-private.h, there are three pre-conditions:
// - n <= this.available()
// - distance > 0
// - distance <= this.since_mark().length()
// - distance <= this.history_available()
if len(args) != 2 {
return fmt.Errorf("check: internal error: inconsistent copy_n_from_history_fast arguments")
@@ -1174,7 +1174,7 @@ check1:
return fmt.Errorf("check: could not prove distance > 0")
}
// Check "distance <= this.since_mark().length()".
// Check "distance <= this.history_available()".
check2:
for {
for _, x := range q.facts {
@@ -1192,22 +1192,18 @@ check2:
continue
}
// Check that the RHS is "recv.since_mark().length()".
// Check that the RHS is "recv.history_available()".
y, method, yArgs := splitReceiverMethodArgs(x.RHS().AsExpr())
if method != t.IDLength || len(yArgs) != 0 {
if method != t.IDHistoryAvailable || len(yArgs) != 0 {
continue
}
z, method, zArgs := splitReceiverMethodArgs(y)
if method != t.IDSinceMark || len(zArgs) != 0 {
continue
}
if !z.Eq(recv) {
if !y.Eq(recv) {
continue
}
break check2
}
return fmt.Errorf("check: could not prove distance <= %s.since_mark().length()", recv.Str(q.tm))
return fmt.Errorf("check: could not prove distance <= %s.history_available()", recv.Str(q.tm))
}
return nil