← Pipelines
success

build #83 ant/term ↗

main @ dae00cf8
push by ant
started 22 Sep 2026 16:40 UTC · · 1 passed
perf: clear only the actual margin instead of the whole pixel buffer
Profiling (see ROADMAP.md's "Performance profiling infrastructure" entry) found render.draw's unconditional fill_rect over the entire pixel buffer -- there only so the right/bottom margin past grid.cols*cell_w/grid.rows*cell_h picks up the theme background when the window size isn't an exact multiple of the cell size -- costing 9.4ms/frame, tied with all of draw_row_backgrounds combined. Every cell draw_row_backgrounds covers gets repainted right after anyway, so clearing the whole buffer was redundant everywhere but the true margin. Fixed by clearing only the right/bottom margin rectangles (skipped entirely when there's no margin in a given dimension), decomposed so the bottom-right corner is covered exactly once. Re-profiling the identical workload confirms it: render.draw_clear dropped from 9.4ms/frame to 0.19ms/frame (~50x), and render.draw's own average fell from 24.3ms/frame to 16.3ms/frame -- now essentially at the 60Hz frame budget on average, though the heaviest frame still exceeds it. draw_row_backgrounds is now clearly the largest remaining cost; see ROADMAP.md's revised "Damage tracking" entry for what that changes. render/render_test.odin gains a regression test for the exact-multiple-in-one-dimension-only case the two-rect decomposition introduces (the existing margin test only covered margin in both dimensions). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

Jobs 1

  1. jobs

    • success
      build
      exit 0

Evaluation

ok · push · 22 Sep 2026 16:40 UTC · synthesised from a run that predates job graphs