Skip to content

fix(web): batch live task transcript updates - #964

Closed
Igloczek wants to merge 1 commit into
open-mercato:mainfrom
Igloczek:fix/live-transcript-cpu
Closed

Igloczek wants to merge 1 commit into
open-mercato:mainfrom
Igloczek:fix/live-transcript-cpu

Conversation

@Igloczek

@Igloczek Igloczek commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Problem

Opening the task detail view, especially while a task was streaming, caused excessive browser rendering and visible frame drops. Large parts of the cockpit were being evaluated even when the task content that was on screen had not changed.

Cause

Two update paths amplified the work:

  1. Live run-summary updates entered the shared run-list cache observed by the application shell, sidebar, and task header. Those updates propagated through the shell and caused the routed task view to be evaluated again.
  2. Each per-run SSE transcript frame immediately produced a React state update. Every update rebuilt the derived thread, regrouped transcript items, and recreated row models, including blocks unaffected by the new frame.

Fix

  • batch per-run transcript frames into one React state update per 50 ms window;
  • batch global run-summary updates before touching the query cache;
  • isolate the routed task view from shell updates with memoized layout boundaries and stable scalar selectors;
  • preserve unchanged transcript blocks and sidebar rows with memoization and equality checks.

The existing event ordering, sequence deduplication, reconnect behavior, buffering, compaction, and user-facing functionality remain unchanged.

Effect

Metric Before After Change
Total React renders 5,392 1,542 -71.4%
React renders / second ~194 ~55 -71.5%
FPS (average / minimum) 60 / 7 60 / 20 minimum improved
Dropped frames (<30 FPS) 9 1 -88.9%

The figures come from React Profiler and describe rendering and frame delivery, not a direct OS CPU measurement. There are no API, event-format, or persisted-data changes.

@CLAassistant

CLAassistant commented Sep 6, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Igloczek Igloczek closed this Sep 6, 2026
@Igloczek
Igloczek deleted the fix/live-transcript-cpu branch September 6, 2026 10:42
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.

2 participants