Commit 3191486
committed
perf: inline warm-cache check in CachedSource.source()
`source()` delegated the hot "cache already filled" read to
`_getCachedSource()`, which means every warm call pays for a prototype
method lookup and a function-call stack frame. Under V8's TurboFan
the call gets inlined, but the interpreter (and CodSpeed's
simulation mode, which runs without optimization) actually pays the
overhead. Inlining the `this._cachedSource !== undefined` short-circuit
brings warm `source()` from ~58 ns/op down to ~41 ns/op under --no-opt
while keeping the buffer-derived path behind the shared helper.
https://claude.ai/code/session_01LZbaaPrnDTu6y7s4nK4cJz1 parent 21af2e8 commit 3191486
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | 220 | | |
217 | 221 | | |
| |||
0 commit comments