Skip to content

[playlists] Speed up large playlist loading#2052

Merged
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:playlist-lazy-annotations
Jun 14, 2026
Merged

[playlists] Speed up large playlist loading#2052
frankrousseau merged 2 commits into
cgwire:mainfrom
frankrousseau:playlist-lazy-annotations

Conversation

@frankrousseau

Copy link
Copy Markdown
Contributor

Problems

  • Opening a large playlist froze the UI: every preview revision carried its annotation blob and all entity cards mounted at once.
  • On long clips the progress bar turned uniform light grey, looking like a bug.

Solutions

  • Load annotations on demand for the current preview and a ±2 window; mount the entity strip progressively via requestIdleCallback.
  • Paint the dense-frame progress bar dark grey instead of exposing the light base.

frankrousseau and others added 2 commits June 14, 2026 09:21
…ively

Opening a large playlist froze the main thread: every preview revision
shipped its annotation blob, and all entity cards mounted at once.

- Fetch annotations on demand for the current preview and a ±2 sliding
  window, cached in previewFileMap with in-flight dedup (reuses
  GET /api/data/preview-files/<id>).
- Mount the PlaylistedEntity strip in batches of 40 via requestIdleCallback
  so the UI is interactive immediately; scrollToEntity self-heals if an
  entity is not mounted yet.
- Draw lazily-loaded annotations without seeking the player (loadSingleAnnotation
  rather than loadAnnotation) so the async load can't move the timeline.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
On long clips each frame falls below 3px and the per-frame stripes are
dropped, which exposed the light base background and looked like a bug.
Paint the dense fallback a solid dark grey matching the stripe tone.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@frankrousseau frankrousseau merged commit 1564029 into cgwire:main Jun 14, 2026
5 checks 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