studio-perf

Optimize Remotion Studio render performance by minimizing frame-reactive component surfaces.

57.9k|4.4k|Updated Jun 23, 2020
One-click install
npx skills add https://github.com/remotion-dev/remotion --skill studio-perf
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: studio-perf
Source: https://github.com/remotion-dev/remotion/tree/main/.agents/skills/studio-perf
Command: npx skills add https://github.com/remotion-dev/remotion --skill studio-perf

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Remotion Studio components that subscribe to the current frame via useTimelinePosition() cause unnecessary re-renders across the entire component tree, leading to sluggish preview performance and wasted CPU cycles during interactive editing.

Core Features & Use Cases

  • Frame Subscription Minimization: Push useTimelinePosition() calls down to the smallest leaf component whose output must change with the frame, keeping parent components stable.
  • Imperative Timeline Reads: Use getCurrentFrame() inside event handlers and on-demand logic instead of subscribing to the reactive timeline hook.
  • Memoization Strategy: Apply React.memo() at stable render boundaries while ensuring props remain referentially stable across frame updates.
  • Use Case: When a parent component reads the current frame only to forward it to a single child, extract a frame-subscribing leaf so the rest of the subtree stops re-rendering on every frame tick.

Quick Start

Use the studio-perf skill to audit my Remotion Studio components and refactor them to minimize unnecessary frame-driven re-renders.

Frequently Asked Questions about studio-perf

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I stop Remotion Studio components from re-rendering every frame?

Push useTimelinePosition() down to the smallest leaf component whose output must change with the frame. Extract a frame-subscribing child so the parent and its other descendants stay stable across frame updates.

What is the difference between useTimelinePosition and getCurrentFrame in Remotion?

useTimelinePosition() is a reactive hook that triggers re-renders when the frame changes, while getCurrentFrame() is an imperative read suited for event handlers and on-demand logic that does not need to subscribe.

Does React.memo work with Remotion Studio frame updates?

React.memo works only when props remain referentially stable across frame updates. Newly created objects, callbacks, styles, or React nodes defeat shallow memoization, so stabilize those props where natural.

Why does my Remotion Studio preview lag during scrubbing?

Preview lag typically comes from too many components subscribing to useTimelinePosition(). Context subscribers also update through memoized ancestors, so isolate frame reads to small leaf components.

When should I avoid memoizing Remotion Studio components?

Avoid memoization when props change behaviorally on every frame or when custom comparators would ignore relevant updates. Memoization is only safe when the component can reliably skip parent-driven renders.