OpenCut-app / OpenCut-app/OpenCut

[PERF] Audio peak extraction blocks main thread — should use Web Worker

Open
#727 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
89.8k
Forks
8.9k
PR merge metrics
No merged PRs in 30d

Description

Description

apps/web/src/components/editor/panels/timeline/audio-waveform.tsx (lines 11-40) has an extractPeaks() function that loops through the entire audio buffer synchronously on the main thread.

Impact

For stereo audio at 44.1kHz with 512 peaks: thousands of calculations that block UI interactions during peak extraction (~100-200ms freeze).

Fix

Move peak extraction to a Web Worker or use requestIdleCallback() to break the work into smaller chunks.

Files

  • apps/web/src/components/editor/panels/timeline/audio-waveform.tsx:11-40

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with apps/web/src/components/editor/panels/timeline/audio-waveform.tsx, especially extractPeaks() at lines 11-40, and trace how peak extraction is invoked. Compare moving the work to a Web Worker with splitting it via requestIdleCallback(). Done means peak extraction no longer blocks UI interactions during the reported 100–200ms freeze.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.