Commit 5d3ddfb
committed
bench: stabilize cached-source construction benchmark
Store the freshly constructed CachedSource instances into a pre-sized
sink array so V8 cannot dead-code-eliminate them and memory pressure
stays consistent between samples. Overwriting existing slots (rather
than push + length reset) keeps the sink's hidden class stable and
avoids resize allocations during measurement. This reduces run-to-run
variance that was surfacing as false codspeed regressions on this
task.1 parent 7db8867 commit 5d3ddfb
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
13 | 23 | | |
14 | 24 | | |
15 | 25 | | |
| |||
31 | 41 | | |
32 | 42 | | |
33 | 43 | | |
34 | | - | |
35 | | - | |
| 44 | + | |
| 45 | + | |
36 | 46 | | |
37 | 47 | | |
38 | 48 | | |
| |||
0 commit comments