mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Remove some suspensions from decode_huffman_fast.
name old speed new speed delta puffs_adler32_10k/clang 2.45GB/s ± 0% 2.41GB/s ± 1% -1.82% (p=0.000 n=9+9) puffs_adler32_100k/clang 2.45GB/s ± 0% 2.41GB/s ± 1% -1.74% (p=0.000 n=9+10) puffs_flate_decode_1k/clang 133MB/s ± 0% 136MB/s ± 2% +1.93% (p=0.003 n=9+9) puffs_flate_decode_10k/clang 181MB/s ± 0% 172MB/s ± 0% -5.18% (p=0.000 n=9+8) puffs_flate_decode_100k/clang 204MB/s ± 0% 206MB/s ± 0% +0.63% (p=0.000 n=10+8) puffs_zlib_decode_10k/clang 168MB/s ± 0% 160MB/s ± 1% -4.82% (p=0.000 n=10+9) puffs_zlib_decode_100k/clang 189MB/s ± 0% 189MB/s ± 1% ~ (p=0.143 n=10+10) puffs_adler32_10k/gcc 3.26GB/s ± 0% 3.27GB/s ± 0% +0.12% (p=0.000 n=10+8) puffs_adler32_100k/gcc 3.27GB/s ± 0% 3.27GB/s ± 0% +0.18% (p=0.000 n=10+8) puffs_flate_decode_1k/gcc 130MB/s ± 0% 141MB/s ± 1% +8.71% (p=0.000 n=10+9) puffs_flate_decode_10k/gcc 203MB/s ± 0% 200MB/s ± 0% -1.72% (p=0.000 n=9+10) puffs_flate_decode_100k/gcc 241MB/s ± 0% 242MB/s ± 0% +0.54% (p=0.000 n=8+9) puffs_zlib_decode_10k/gcc 188MB/s ± 0% 188MB/s ± 0% +0.26% (p=0.000 n=9+10) puffs_zlib_decode_100k/gcc 223MB/s ± 0% 225MB/s ± 0% +0.93% (p=0.000 n=9+8)
This commit is contained in:
1 parent
ccdd74a17f
commit
058938006a
3 files changed
+18
-17
No files matched your search
@@ -507,10 +507,13 @@ func (g *gen) writeCallSuspendibles(b *buffer, n *a.Expr, depth uint32) error {
|
||||
b.printf("%srptr_src += %s;\n", bPrefix, scratchName)
|
||||
|
||||
} else if isInDst(g.tm, n, t.KeyWriteU8, 1) {
|
||||
b.printf("if (%swptr_dst == %swend_dst) { status = %sSUSPENSION_SHORT_WRITE;",
|
||||
bPrefix, bPrefix, g.PKGPREFIX)
|
||||
b.writes("goto suspend;")
|
||||
b.writes("}\n")
|
||||
if !n.ProvenNotToSuspend() {
|
||||
b.printf("if (%swptr_dst == %swend_dst) { status = %sSUSPENSION_SHORT_WRITE;",
|
||||
bPrefix, bPrefix, g.PKGPREFIX)
|
||||
b.writes("goto suspend;")
|
||||
b.writes("}\n")
|
||||
}
|
||||
|
||||
b.printf("*%swptr_dst++ = ", bPrefix)
|
||||
x := n.Args()[0].Arg().Value()
|
||||
if err := g.writeExpr(b, x, replaceCallSuspendibles, parenthesesMandatory, depth); err != nil {
|
||||
|
||||
+1
-11
@@ -2081,11 +2081,6 @@ static puffs_flate__status puffs_flate__flate_decoder__decode_huffman_fast(
|
||||
v_bits >>= v_table_entry_n_bits;
|
||||
v_n_bits -= v_table_entry_n_bits;
|
||||
if ((v_table_entry >> 31) != 0) {
|
||||
PUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
|
||||
if (b_wptr_dst == b_wend_dst) {
|
||||
status = PUFFS_FLATE__SUSPENSION_SHORT_WRITE;
|
||||
goto suspend;
|
||||
}
|
||||
*b_wptr_dst++ = ((v_table_entry >> 8) & 255);
|
||||
goto label_0_continue;
|
||||
} else if ((v_table_entry >> 30) != 0) {
|
||||
@@ -2119,11 +2114,6 @@ static puffs_flate__status puffs_flate__flate_decoder__decode_huffman_fast(
|
||||
v_bits >>= v_table_entry_n_bits;
|
||||
v_n_bits -= v_table_entry_n_bits;
|
||||
if ((v_table_entry >> 31) != 0) {
|
||||
PUFFS_BASE__COROUTINE_SUSPENSION_POINT(2);
|
||||
if (b_wptr_dst == b_wend_dst) {
|
||||
status = PUFFS_FLATE__SUSPENSION_SHORT_WRITE;
|
||||
goto suspend;
|
||||
}
|
||||
*b_wptr_dst++ = ((v_table_entry >> 8) & 255);
|
||||
goto label_0_continue;
|
||||
} else if ((v_table_entry >> 30) != 0) {
|
||||
@@ -2316,7 +2306,7 @@ static puffs_flate__status puffs_flate__flate_decoder__decode_huffman_fast(
|
||||
label_0_break:;
|
||||
while (v_n_bits >= 8) {
|
||||
v_n_bits -= 8;
|
||||
PUFFS_BASE__COROUTINE_SUSPENSION_POINT(3);
|
||||
PUFFS_BASE__COROUTINE_SUSPENSION_POINT(1);
|
||||
if (b_rptr_src == b_rstart_src) {
|
||||
status = PUFFS_FLATE__ERROR_INVALID_I_O_OPERATION;
|
||||
goto exit;
|
||||
|
||||
+10
-2
@@ -245,8 +245,16 @@ func (q *checker) bcheckStatement(n *a.Node) error {
|
||||
return q.bcheckAssignment(n.LHS(), n.Operator(), n.RHS())
|
||||
|
||||
case a.KExpr:
|
||||
_, _, err := q.bcheckExpr(n.Expr(), 0)
|
||||
return err
|
||||
n := n.Expr()
|
||||
if _, _, err := q.bcheckExpr(n, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
if n.Suspendible() {
|
||||
if err := q.bcheckIOMethods(n, 0); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
case a.KIf:
|
||||
return q.bcheckIf(n.If())
|
||||
|
||||
Reference in new issue
Block a user