Skip to content

Replace LineStack with MultiLineGraphic for performance#2

Merged
cboulay merged 1 commit intomainfrom
temp_faster_multiline
Mar 18, 2026
Merged

Replace LineStack with MultiLineGraphic for performance#2
cboulay merged 1 commit intomainfrom
temp_faster_multiline

Conversation

@cboulay
Copy link
Copy Markdown
Member

@cboulay cboulay commented Mar 18, 2026

After migrating phosphor from custom wgpu shaders to fastplotlib, performance regressed for dense multichannel displays. The root cause is that LineStack creates separate LineGraphic objects per channel, and the update loop in _update_graphics() performs N separate GPU buffer assignments:

for ch in range(buf.n_visible):
    self._line_stack[ch].data[idx_start:idx_end] = data_slice[ch]

@pperanich's MultiLineGraphic in his fastplotlib fork packs all lines into a single GPU buffer, allowing bulk updates in one assignment. This plan adopts his fork as an immediate performance fix.

See ezmsg-org/ezmsg#229

@cboulay cboulay merged commit 77c7fb0 into main Mar 18, 2026
11 checks passed
@cboulay cboulay deleted the temp_faster_multiline branch March 18, 2026 22:13
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