Skip to content

Waveform: batch grid lines into one geometry per render#12072

Merged
niksedk merged 1 commit into
mainfrom
perf/waveform-gridline-batching
Jul 2, 2026
Merged

Waveform: batch grid lines into one geometry per render#12072
niksedk merged 1 commit into
mainfrom
perf/waveform-gridline-batching

Conversation

@niksedk

@niksedk niksedk commented Jul 2, 2026

Copy link
Copy Markdown
Member

Follow-up to #12069.

With grid lines enabled, DrawAllGridLines issued one context.DrawLine per grid line — at default zoom that's ~250–400 separate scene-graph draw ops per render, 60 times a second during playback. The timeline ticks already solved this with a StreamGeometry batch (DrawVerticalLineBatch); the grid never got the same treatment.

The vertical/horizontal line positions are computed exactly as before (same 0.1 s / 1 s intervals, same frame-boundary stepping in frame mode, same square-grid spacing), collected into a pooled list, and drawn with a single DrawGeometry call.

Verified visually on macOS — grid rendering is unchanged. All 512 UI tests pass.

🤖 Generated with Claude Code

With grid lines enabled, the grid was drawn as hundreds of individual
DrawLine calls per frame (a vertical line every ~10 px plus matching
horizontals) - real scene-graph overhead at 60 fps during playback.
Collect the positions and draw the whole grid as a single
StreamGeometry, the same approach the timeline ticks already use.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@niksedk niksedk merged commit e52eb0e into main Jul 2, 2026
1 of 3 checks passed
@niksedk niksedk deleted the perf/waveform-gridline-batching branch July 2, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant