The per-visible-row loop in renderContent does five ctx.font assignments (main.ts:594, 636, 640, 646, 654) and at least three measureText calls per row. Almost all of it is constant for the whole frame.
Scope — the deterministic parts only
- Hoist the three zoom-derived font strings above the loop at
main.ts:560
- Delete the
:654 re-assignment by reordering the sha and author draws. Its own comment at :650-653 admits it only exists because :646 clobbered the font
- Hoist
shaW: 7 characters is enforced, not merely documented (commands.rs:393, main.ts:636), so it never needs re-measuring
Deliberately out of scope
A content memo was considered and is not part of this. If anyone adds one later it must be keyed on text content, not (row, maxw, font) — BACKEND.rows is mutated in place at :3223 and :3248 without changing the graph object's identity, so an identity-keyed memo would serve stale text.
Measurement
Existing DEV HUD millisecond counter, before and after, on a ref-dense repository. No HUD delta, no merge.
Good first issue
Mechanical, local to one function, and the correctness bar is simply "the canvas still looks identical."
Found during v1.3.0 research: parallel codebase surveys, then each finding independently verified against the code before filing. Line numbers are from dev at the time of writing.
The per-visible-row loop in
renderContentdoes fivectx.fontassignments (main.ts:594, 636, 640, 646, 654) and at least threemeasureTextcalls per row. Almost all of it is constant for the whole frame.Scope — the deterministic parts only
main.ts:560:654re-assignment by reordering the sha and author draws. Its own comment at:650-653admits it only exists because:646clobbered the fontshaW: 7 characters is enforced, not merely documented (commands.rs:393,main.ts:636), so it never needs re-measuringDeliberately out of scope
A content memo was considered and is not part of this. If anyone adds one later it must be keyed on text content, not
(row, maxw, font)—BACKEND.rowsis mutated in place at:3223and:3248without changing the graph object's identity, so an identity-keyed memo would serve stale text.Measurement
Existing DEV HUD millisecond counter, before and after, on a ref-dense repository. No HUD delta, no merge.
Good first issue
Mechanical, local to one function, and the correctness bar is simply "the canvas still looks identical."
Found during v1.3.0 research: parallel codebase surveys, then each finding independently verified against the code before filing. Line numbers are from
devat the time of writing.