mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-19 08:38:14 +01:00
Unconditionally resume local vars
This commit will immediately be followed by a rollback, but it is committed anyway so that we can refer to these numbers in the git log. name old speed new speed delta wuffs_deflate_decode_1k/clang 145MB/s ± 1% 141MB/s ± 1% -2.28% (p=0.000 n=19+19) wuffs_deflate_decode_10k/clang 222MB/s ± 0% 202MB/s ± 1% -9.39% (p=0.000 n=16+18) wuffs_deflate_decode_100k/clang 256MB/s ± 0% 237MB/s ± 1% -7.64% (p=0.000 n=20+20) wuffs_deflate_decode_1k/gcc 157MB/s ± 2% 158MB/s ± 1% +0.73% (p=0.001 n=20+19) wuffs_deflate_decode_10k/gcc 247MB/s ± 1% 251MB/s ± 0% +1.72% (p=0.000 n=19+18) wuffs_deflate_decode_100k/gcc 289MB/s ± 0% 286MB/s ± 0% -0.86% (p=0.000 n=17+18) wuffs_lzw_decode_20k/clang 121MB/s ± 1% 122MB/s ± 1% +1.04% (p=0.000 n=17+19) wuffs_lzw_decode_100k/clang 163MB/s ± 1% 164MB/s ± 1% +0.33% (p=0.010 n=19+18) wuffs_gif_decode_1k/clang 348MB/s ± 1% 361MB/s ± 2% +3.62% (p=0.000 n=20+20) wuffs_gif_decode_10k/clang 132MB/s ± 1% 130MB/s ± 1% -1.49% (p=0.000 n=20+19) wuffs_gif_decode_100k/clang 114MB/s ± 0% 116MB/s ± 1% +1.24% (p=0.000 n=19+20) wuffs_gif_decode_1000k/clang 117MB/s ± 0% 118MB/s ± 1% +1.16% (p=0.000 n=17+20) wuffs_lzw_decode_20k/gcc 153MB/s ± 1% 162MB/s ± 1% +6.05% (p=0.000 n=18+19) wuffs_lzw_decode_100k/gcc 216MB/s ± 1% 228MB/s ± 0% +5.29% (p=0.000 n=20+19) wuffs_gif_decode_1k/gcc 444MB/s ± 1% 388MB/s ± 1% -12.62% (p=0.000 n=19+18) wuffs_gif_decode_10k/gcc 148MB/s ± 0% 126MB/s ± 0% -14.50% (p=0.000 n=19+19) wuffs_gif_decode_100k/gcc 137MB/s ± 0% 114MB/s ± 1% -16.69% (p=0.000 n=19+18) wuffs_gif_decode_1000k/gcc 139MB/s ± 1% 117MB/s ± 0% -16.02% (p=0.000 n=20+17) wuffs_adler32_10k/clang 2.44GB/s ± 0% 2.44GB/s ± 1% ~ (p=0.258 n=18+17) wuffs_adler32_100k/clang 2.45GB/s ± 0% 2.44GB/s ± 0% -0.11% (p=0.005 n=17+16) wuffs_zlib_decode_10k/clang 204MB/s ± 0% 188MB/s ± 0% -7.82% (p=0.000 n=17+18) wuffs_zlib_decode_100k/clang 232MB/s ± 0% 218MB/s ± 0% -5.90% (p=0.000 n=19+17) wuffs_adler32_10k/gcc 3.22GB/s ± 1% 3.25GB/s ± 0% +1.01% (p=0.000 n=19+20) wuffs_adler32_100k/gcc 3.22GB/s ± 0% 3.25GB/s ± 0% +0.95% (p=0.000 n=16+18) wuffs_zlib_decode_10k/gcc 229MB/s ± 1% 233MB/s ± 0% +1.71% (p=0.000 n=18+19) wuffs_zlib_decode_100k/gcc 262MB/s ± 0% 265MB/s ± 0% +1.04% (p=0.000 n=17+18)
This commit is contained in:
1 parent
e93a750ccf
commit
2b6b0acb4f
5 files changed
+73
-129
No files matched your search
@@ -225,18 +225,12 @@ func (g *gen) writeFuncImplHeader(b *buffer) error {
|
||||
|
||||
func (g *gen) writeFuncImplBodyResume(b *buffer) error {
|
||||
if g.currFunk.suspendible {
|
||||
// TODO: don't hard-code [0], and allow recursive coroutines.
|
||||
b.printf("uint32_t coro_susp_point = self->private_impl.%s%s[0].coro_susp_point;\n",
|
||||
cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
|
||||
b.printf("if (coro_susp_point) {\n")
|
||||
if err := g.writeResumeSuspend(b, g.currFunk.astFunc.Body(), false, false); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes("} else {\n")
|
||||
if err := g.writeResumeSuspend(b, g.currFunk.astFunc.Body(), false, true); err != nil {
|
||||
return err
|
||||
}
|
||||
b.writes("}\n")
|
||||
// TODO: don't hard-code [0], and allow recursive coroutines.
|
||||
b.printf("uint32_t coro_susp_point = self->private_impl.%s%s[0].coro_susp_point;\n",
|
||||
cPrefix, g.currFunk.astFunc.FuncName().Str(g.tm))
|
||||
// Generate a coroutine switch similiar to the technique in
|
||||
// https://www.chiark.greenend.org.uk/~sgtatham/coroutines.html
|
||||
//
|
||||
|
||||
@@ -296,6 +296,7 @@ func (g *gen) visitVars(b *buffer, block []*a.Node, depth uint32, f func(*gen, *
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO: initBoolTypedVars is never used.
|
||||
func (g *gen) writeResumeSuspend1(b *buffer, n *a.Var, suspend bool, initBoolTypedVars bool) error {
|
||||
local := fmt.Sprintf("%s%s", vPrefix, n.Name().Str(g.tm))
|
||||
|
||||
|
||||
Reference in new issue
Block a user