Skip to content

ui: fix dashboard freezes in live mode - #1

Merged
razmser merged 1 commit into
masterfrom
ui-live-mode-perf
Oct 9, 2026
Merged

razmser merged 1 commit into
masterfrom
ui-live-mode-perf

Conversation

@razmser

@razmser razmser commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Live mode moves the time range every second. On a big dashboard this made every plot redraw every second and left-menu previews block the main thread on canvas readback, so the page froze for seconds and opening a plot took 5-10 s in Firefox.

  • useMetricData: don't renormalize the same response on time range ticks; depend on heal status and theme instead. Drop the unused timeRange param of normalizePlotData and PlotData.lastTimeRange.
  • UPlotWrapper: one coalesced draw per scale update (redraw then setScale, no batch, so the y-lock reset still sees the parent ref); skip sub-pixel x shifts; reapply scales after resize.
  • Plot previews: replay uPlot's cached paths onto a software canvas instead of drawImage from the plot canvas, throttle to one per plot per 5 s, keep the old preview while series aren't drawn yet.

Live mode moves the time range every second. On a big dashboard this
made every plot redraw every second and left-menu previews block the
main thread on canvas readback, so the page froze for seconds and
opening a plot took 5-10 s in Firefox.

- useMetricData: don't renormalize the same response on time range
  ticks; depend on heal status and theme instead. Drop the unused
  timeRange param of normalizePlotData and PlotData.lastTimeRange.
- UPlotWrapper: one coalesced draw per scale update (redraw then
  setScale, no batch, so the y-lock reset still sees the parent ref);
  skip sub-pixel x shifts; reapply scales after resize.
- Plot previews: replay uPlot's cached paths onto a software canvas
  instead of drawImage from the plot canvas, throttle to one per plot
  per 5 s, keep the old preview while series aren't drawn yet.
@razmser
razmser merged commit 2b06d95 into master Oct 9, 2026
1 check passed
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