Skip to content

@remotion/studio: 10MB LRU cache for timeline video frames#6960

Merged
JonnyBurger merged 2 commits intomainfrom
feature/lru-frame-cache
Apr 1, 2026
Merged

@remotion/studio: 10MB LRU cache for timeline video frames#6960
JonnyBurger merged 2 commits intomainfrom
feature/lru-frame-cache

Conversation

@JonnyBurger
Copy link
Copy Markdown
Member

Summary

  • Replace count-based frame eviction with a size-based 10MB LRU cache using VideoFrame.allocationSize()
  • Frames persist for the lifetime of the page instead of being cleared on component unmount
  • Improves timeline scrolling experience by retaining previously decoded frames

Test plan

  • Open the Studio and verify timeline filmstrip thumbnails render correctly
  • Scroll back and forth in the timeline and confirm previously visible frames load instantly from cache
  • Open a long video and verify memory stays bounded around 10MB of frame data

🤖 Generated with Claude Code

Replace count-based frame eviction with a size-based 10MB LRU cache.
Frames now persist for the lifetime of the page instead of being
cleared on component unmount, improving the experience when scrolling
back and forth in the timeline.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@pullfrog
Copy link
Copy Markdown
Contributor

pullfrog bot commented Apr 1, 2026

Reviewed PR #6960 — no actionable issues found. The size-based LRU cache implementation is correct and well-structured. Approved.

Task list (5/5 completed)
  • Read the diff and understand the changes
  • Read full source files for context
  • Analyze correctness, edge cases, and memory management
  • Check for stale references to removed exports
  • Submit review

Pullfrog  | View workflow run | Triggered by Pullfrog | Using Big Pickle (free) | 𝕏

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bugs Ready Ready Preview, Comment Apr 1, 2026 0:52am
remotion Ready Ready Preview, Comment Apr 1, 2026 0:52am

Request Review

Copy link
Copy Markdown
Contributor

@pullfrog pullfrog bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean change. Size-based LRU with allocationSize() is the right approach — totalCacheSize tracking is consistent across add/evict/replace paths, lastUsed is updated on both writes (addFrameToCache) and reads (fillWithCachedFrames), and no stale references to the removed exports remain.

Pullfrog  | View workflow run | Using Big Pickle (free) | 𝕏

@JonnyBurger JonnyBurger enabled auto-merge (squash) April 1, 2026 12:34
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JonnyBurger JonnyBurger merged commit ad95326 into main Apr 1, 2026
18 checks passed
@JonnyBurger JonnyBurger deleted the feature/lru-frame-cache branch April 1, 2026 12:59
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