OpenCut-app / OpenCut-app/OpenCut
[PERF] Audio peak extraction blocks main thread — should use Web Worker
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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