mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-18 16:32:11 +01:00
Remove some suspensions from decode_huffman_fast.
name old speed new speed delta puffs_adler32_10k/clang 2.41GB/s ± 1% 2.39GB/s ± 2% -0.88% (p=0.022 n=9+10) puffs_adler32_100k/clang 2.41GB/s ± 1% 2.39GB/s ± 2% ~ (p=0.095 n=10+9) puffs_flate_decode_1k/clang 136MB/s ± 2% 134MB/s ± 1% -0.86% (p=0.036 n=9+8) puffs_flate_decode_10k/clang 172MB/s ± 0% 175MB/s ± 0% +1.96% (p=0.000 n=8+9) puffs_flate_decode_100k/clang 206MB/s ± 0% 209MB/s ± 1% +1.38% (p=0.000 n=8+9) puffs_zlib_decode_10k/clang 160MB/s ± 1% 163MB/s ± 2% +1.73% (p=0.001 n=9+9) puffs_zlib_decode_100k/clang 189MB/s ± 1% 188MB/s ± 6% ~ (p=0.143 n=10+10) puffs_adler32_10k/gcc 3.27GB/s ± 0% 3.20GB/s ± 2% -2.03% (p=0.000 n=8+10) puffs_adler32_100k/gcc 3.27GB/s ± 0% 3.21GB/s ± 1% -1.89% (p=0.000 n=8+10) puffs_flate_decode_1k/gcc 141MB/s ± 1% 139MB/s ± 1% -1.66% (p=0.000 n=9+10) puffs_flate_decode_10k/gcc 200MB/s ± 0% 209MB/s ± 1% +4.73% (p=0.000 n=10+10) puffs_flate_decode_100k/gcc 242MB/s ± 0% 237MB/s ± 0% -2.19% (p=0.000 n=9+10) puffs_zlib_decode_10k/gcc 188MB/s ± 0% 195MB/s ± 1% +3.71% (p=0.000 n=10+10) puffs_zlib_decode_100k/gcc 225MB/s ± 0% 221MB/s ± 0% -1.84% (p=0.000 n=8+9)
This commit is contained in:
1 parent
058938006a
commit
0bc6f792fb
5 files changed
+24
-92
No files matched your search
@@ -117,6 +117,11 @@ func (g *gen) writeFuncPrototype(b *buffer, n *a.Func) error {
|
||||
func (g *gen) writeFuncImpl(b *buffer, n *a.Func) error {
|
||||
k := g.funks[n.QID()]
|
||||
|
||||
// TODO: delete this. This bool should only last for one git commit, to
|
||||
// separate one conceptual code change into two diff's: one small semantic
|
||||
// diff and one large cosmetic diff.
|
||||
temporaryIndentationHack := k.cName == "puffs_flate__flate_decoder__decode_huffman_fast"
|
||||
|
||||
if err := g.writeFuncSignature(b, n); err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -124,10 +129,14 @@ func (g *gen) writeFuncImpl(b *buffer, n *a.Func) error {
|
||||
b.writex(k.bHeader)
|
||||
if k.suspendible && k.coroSuspPoint > 0 {
|
||||
b.writex(k.bBodyResume)
|
||||
} else if temporaryIndentationHack {
|
||||
b.writes("{\n")
|
||||
}
|
||||
b.writex(k.bBody)
|
||||
if k.suspendible && k.coroSuspPoint > 0 {
|
||||
b.writex(k.bBodySuspend)
|
||||
} else if temporaryIndentationHack {
|
||||
b.writes("}\n")
|
||||
}
|
||||
b.writex(k.bFooter)
|
||||
b.writes("}\n\n")
|
||||
|
||||
@@ -460,12 +460,10 @@ func (g *gen) writeCallSuspendibles(b *buffer, n *a.Expr, depth uint32) error {
|
||||
b.printf(" = *%srptr_src++;\n", bPrefix)
|
||||
|
||||
} else if isInSrc(g.tm, n, t.KeyUnreadU8, 0) {
|
||||
if !n.ProvenNotToSuspend() {
|
||||
b.printf("if (%srptr_src == %srstart_src) { status = %sERROR_INVALID_I_O_OPERATION;",
|
||||
bPrefix, bPrefix, g.PKGPREFIX)
|
||||
b.writes("goto exit;")
|
||||
b.writes("}\n")
|
||||
}
|
||||
b.printf("if (%srptr_src == %srstart_src) { status = %sERROR_INVALID_I_O_OPERATION;",
|
||||
bPrefix, bPrefix, g.PKGPREFIX)
|
||||
b.writes("goto exit;")
|
||||
b.writes("}\n")
|
||||
b.printf("%srptr_src--;\n", bPrefix)
|
||||
|
||||
} else if isInSrc(g.tm, n, t.KeyReadU16BE, 0) {
|
||||
|
||||
Reference in new issue
Block a user