Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Heuristic:0xsline OpenChatCut Render Concurrency Tuning

From Leeroopedia
Knowledge Sources
Domains Optimization, Rendering
Last Updated 2026-10-22 14:00 GMT

Overview

Auto-tune Remotion render concurrency and OffthreadVideo threads based on CPU cores and available RAM, overriding Remotion's conservative default of 50% (capped at 8).

Description

OpenChatCut calculates render concurrency as 80% of logical CPU cores, capped at 24. Memory is also budgeted: half of physical RAM is reserved for Electron and the OS, and the remainder is divided at ~1.25 GiB per headless render tab. The final concurrency is the minimum of the CPU target, memory target, and 24. OffthreadVideo threads (memory-heavy video decoding) are scaled more conservatively: 1 thread for <= 2 cores, otherwise 2-4 threads based on `ceil(cores / 4)`. The `OPENCHATCUT_RENDER_CONCURRENCY` env var can override with an absolute number or percentage.

Usage

Use this heuristic when configuring video export rendering on workstations with many cores or large RAM. Apply it when exports are slower than expected — Remotion's default 50% (capped at 8) leaves performance unused on modern Apple Silicon and Windows machines. Also use it to limit concurrency on memory-constrained machines.

The Insight (Rule of Thumb)

  • Action: Set concurrency = `min(24, round(cores * 0.8), floor((RAM_GB * 0.5) / 1.25))`.
  • Value: 80% CPU target, 50% RAM budget at 1.25 GiB/tab, max 24 concurrent tabs. OffthreadVideo: `min(4, max(2, ceil(cores/4)))` for > 2 cores.
  • Trade-off: Higher concurrency speeds rendering but increases memory pressure and may starve the Electron UI.
  • Compatibility: Override with `OPENCHATCUT_RENDER_CONCURRENCY=12` (absolute) or `OPENCHATCUT_RENDER_CONCURRENCY=50%` (percentage of cores).

Reasoning

Remotion's default concurrency is 50% of cores capped at 8, which is very conservative for modern 16-32 core machines. Using 80% of cores (leaving 1-2 for Electron/OS) gives near-linear speedup on multi-core machines. The memory budget prevents OOM on machines with many cores but limited RAM — each headless Chrome tab rendering video consumes ~1.25 GiB. OffthreadVideo is scaled separately because it decodes video frames in parallel, which is memory-intensive and benefits less from high thread counts.

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment