Commit 0bc94ed
Make funAsync wrappers plain functions: drop the double promise layer
The wrapped f is itself async, so an async wrapper allocated a second
promise per call that merely resolved to the callee's promise. The
wrappers (arity-specialized and the generic fallback) are now plain
functions returning the callee's promise directly. Wrappers carry an
own-property async:true marker; fun's dispatch and js.async? test it
alongside instanceof AsyncFunction. The compiler's sync-call detection
is purely syntactic and never inspects wrapper asyncness (audited all
AsyncFunction uses across lib/ and bin/).
Wrapper-level awaited recursion: deno 1.57x, bun 1.40x, node ~1.0x
(V8 already fast-paths the chained layer). Kernel suite improved in
every paired round on node and deno, directionally on bun. All suites
green on node, bun 1.3.14, and deno 2.8.3: backend 369, frontend 10,
kernel 134/134 on all three engines, extensions, ratatoskr e2e, smoke.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 12a888a commit 0bc94ed
2 files changed
Lines changed: 23 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
139 | 148 | | |
140 | | - | |
| 149 | + | |
141 | 150 | | |
142 | 151 | | |
143 | | - | |
| 152 | + | |
144 | 153 | | |
145 | 154 | | |
146 | | - | |
| 155 | + | |
147 | 156 | | |
148 | 157 | | |
149 | | - | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | | - | |
| 161 | + | |
153 | 162 | | |
154 | 163 | | |
155 | 164 | | |
156 | 165 | | |
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
160 | | - | |
161 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
162 | 174 | | |
163 | | - | |
| 175 | + | |
164 | 176 | | |
165 | 177 | | |
166 | 178 | | |
| |||
0 commit comments