TS typescript · a worked example

autor3search-typescript demo: −92.55% on code written slow on purpose

FIXTURE not a third-party library
HEADLINE
−92.55%
own demo code, written slow on purpose

before → after

bar length is relative to the before value
countWords ms/op−92.55%
before
3.59
after
0.268

what changed

A countWords whose hot loop rebuilt the whole array per character. chars.concat([c]) became chars.push(c).

3 experiments

1
kept
1
discarded
1
failed

note — the same live session discarded a no-op commit against the advanced baseline, and failed a scope violation. A big percentage off a demo is easy to earn. It is not a claim about real code.

how it was measured

tool
vitest bench
rounds
interleaved rounds per side
verdict rule
KEEP needs one significant improvement, no significant regression past max_regress_pct, and a geomean that beats min_effect_pct.

LIMITS

Results hold only for the benchmarks a run measures. Inputs they do not cover can get slower. Check your hot paths before you merge.