Commit 21af2e8
committed
perf: defer _cachedBuffers allocation in CachedSource
Follow-up to the _cachedSize deferral: PR #204 added a new
`this._cachedBuffers = undefined` preallocation to the CachedSource
constructor, which re-introduces the same per-construction cost we
previously removed from RawSource/OriginalSource/SourceMapSource.
`_cachedBuffers` is only read from `buffer()` and `buffers()`, and both
call sites already guard with `!== undefined`, which treats missing
properties identically to an undefined slot. Drop the eager assignment
so every CachedSource construction skips one write and one hidden-class
transition, and instances that never call `buffers()` stay on a
tighter shape.
https://claude.ai/code/session_01LZbaaPrnDTu6y7s4nK4cJz1 parent 4d32b91 commit 21af2e8
1 file changed
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 145 | | |
151 | 146 | | |
152 | 147 | | |
| |||
0 commit comments