Answer a turn's outcome in one pass, and build the clock format once

computeInputOutcomes scanned the transcript once per input, and it runs on every timeline change: quadratic, and at 4800 records the largest single cost left in the console (26% + 13% + 12% of sampled main-thread time). It is now one walk that gathers each turn's evidence as it finds the segments, it lives in the data layer where it can be tested, and a differential test pins it to the algorithm it replaced. An Intl.DateTimeFormat was also constructed per rendered row per render (8% of main-thread time at 4800 records); it is built once. One pass reads each record twice whatever the length; the old scan read 2, 52, 102, 199, 398 times per record as the transcript doubled. 1440 records: 4.0s -> 1.1s. 4800 records: 34.3s -> 5.5s (from 120.3s before either change).

6d202ae3 parent 4cf69877 +351 −68
browse files