Skip to content

Comments

Optimize TranscriptionWorkerClient to use Transferables#105

Closed
ysdede wants to merge 1 commit intoaudit/perf-degradation-resource-mgmtfrom
fix-worker-message-overhead-9617886535104194940
Closed

Optimize TranscriptionWorkerClient to use Transferables#105
ysdede wants to merge 1 commit intoaudit/perf-degradation-resource-mgmtfrom
fix-worker-message-overhead-9617886535104194940

Conversation

@ysdede
Copy link
Owner

@ysdede ysdede commented Feb 12, 2026

This PR addresses performance issues related to main thread overhead when communicating with the Transcription Worker. By using Transferable objects for large audio and feature buffers, we eliminate the structured cloning cost, significantly reducing the time spent in HandlePostMessage on the main thread. This ensures smoother UI performance during active transcription.


PR created automatically by Jules for task 9617886535104194940 started by @ysdede

- Updated `TranscriptionWorkerClient.ts` to support transferring `ArrayBuffer` ownership in `sendRequest`.
- Modified `processChunk`, `processV3Chunk`, `processV3ChunkWithFeatures`, `transcribeSegment`, and `processV4ChunkWithFeatures` to transfer audio and feature buffers instead of copying them.
- This reduces main thread blocking during high-frequency worker communication, addressing performance issues noted in `issue-4-worker-message-overhead.md`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Repository owner deleted a comment from google-labs-jules bot Feb 17, 2026
Repository owner deleted a comment from coderabbitai bot Feb 17, 2026
@ysdede
Copy link
Owner Author

ysdede commented Feb 20, 2026

Superseded by PR #141 which implements a broader zero-copy transfer protocol.

@ysdede ysdede closed this Feb 20, 2026
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