mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 16:55:11 +01:00
Make deflate's decode_huffman_fast ! not !?
name old speed new speed delta wuffs_deflate_decode_1k/clang 138MB/s ± 0% 139MB/s ± 0% +0.75% (p=0.008 n=5+5) wuffs_deflate_decode_10k/clang 233MB/s ± 0% 226MB/s ± 0% -2.83% (p=0.008 n=5+5) wuffs_deflate_decode_100k/clang 273MB/s ± 0% 259MB/s ± 1% -5.20% (p=0.008 n=5+5) wuffs_deflate_decode_1k/gcc 158MB/s ± 1% 157MB/s ± 0% ~ (p=0.151 n=5+5) wuffs_deflate_decode_10k/gcc 266MB/s ± 1% 261MB/s ± 0% -1.95% (p=0.008 n=5+5) wuffs_deflate_decode_100k/gcc 314MB/s ± 0% 316MB/s ± 0% +0.48% (p=0.032 n=5+5)
This commit is contained in:
1 parent
7748216b57
commit
a80962d502
6 files changed
+75
-27
No files matched your search
@@ -185,6 +185,7 @@ func (g *gen) gatherFuncImpl(_ *buffer, n *a.Func) error {
|
||||
if err := g.findVars(); err != nil {
|
||||
return err
|
||||
}
|
||||
g.findDerivedVars()
|
||||
|
||||
if err := g.writeFuncImplPrologue(&g.currFunk.bPrologue); err != nil {
|
||||
return err
|
||||
@@ -257,7 +258,9 @@ func (g *gen) writeFuncImplPrologue(b *buffer) error {
|
||||
}
|
||||
}
|
||||
|
||||
if g.currFunk.astFunc.Effect().Optional() {
|
||||
if g.currFunk.astFunc.Effect().Optional() ||
|
||||
(g.currFunk.returnsStatus && (len(g.currFunk.derivedVars) > 0)) {
|
||||
// TODO: rename the "status" variable to "ret"?
|
||||
b.printf("wuffs_base__status status = NULL;\n")
|
||||
}
|
||||
b.writes("\n")
|
||||
@@ -268,7 +271,6 @@ func (g *gen) writeFuncImplPrologue(b *buffer) error {
|
||||
}
|
||||
b.writes("\n")
|
||||
|
||||
g.findDerivedVars()
|
||||
if g.currFunk.derivedVars != nil {
|
||||
for _, o := range g.currFunk.astFunc.In().Fields() {
|
||||
o := o.AsField()
|
||||
@@ -332,7 +334,9 @@ func (g *gen) writeFuncImplBodySuspend(b *buffer) error {
|
||||
}
|
||||
|
||||
func (g *gen) writeFuncImplEpilogue(b *buffer) error {
|
||||
if g.currFunk.astFunc.Effect().Optional() {
|
||||
if g.currFunk.astFunc.Effect().Optional() ||
|
||||
(g.currFunk.returnsStatus && (len(g.currFunk.derivedVars) > 0)) {
|
||||
|
||||
b.writes("goto exit;exit:") // The goto avoids the "unused label" warning.
|
||||
}
|
||||
|
||||
@@ -346,7 +350,9 @@ func (g *gen) writeFuncImplEpilogue(b *buffer) error {
|
||||
b.writes("\n")
|
||||
}
|
||||
|
||||
if g.currFunk.astFunc.Effect().Optional() {
|
||||
if g.currFunk.astFunc.Effect().Optional() ||
|
||||
(g.currFunk.returnsStatus && (len(g.currFunk.derivedVars) > 0)) {
|
||||
|
||||
if g.currFunk.astFunc.Public() {
|
||||
b.writes("if (wuffs_base__status__is_error(status)) { " +
|
||||
"self->private_impl.magic = WUFFS_BASE__DISABLED; }\n")
|
||||
|
||||
Reference in new issue
Block a user