You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
perf(prefix-source): cache buffer() and buffers() to address efficient-buffer TODO
Mirrors the _valueAsBuffer caching used by RawSource, OriginalSource,
and SourceMapSource. Without caching every buffer()/size() call
re-runs the regex replace and re-encodes the prefixed string;
buffers() rebuilt the splice array each call.
Caching is gated on isDualStringBufferCachingEnabled() to honor the
same memory-vs-CPU knob the rest of the codebase uses.
Controlled A/B/A bench (es6-promise.js fixture, 10 calls per task):
buffer(): 1058 -> 10898 ops/s (~10.5x)
buffers(): 1066 -> 13246 ops/s (~12.6x)
size(): 1049 -> 10766 ops/s (~10.3x; goes through buffer().length)
The first call still does the work; calls 2..N return the cached
values, which is the realistic shape of webpack's hot path (size +
buffer + map + updateHash on the same source).
https://claude.ai/code/session_01EHhGq9PRFRGefVtwwasCqZ
0 commit comments