Optimize TranscriptionDisplay scrolling and BufferWorker memory usage#92
Optimize TranscriptionDisplay scrolling and BufferWorker memory usage#92
Conversation
… BufferWorker - Replaced MutationObserver with SolidJS createEffect in TranscriptionDisplay.tsx to fix forced reflow issues and improve scrolling performance. - Reduced maxDurationSec for unused 'audio' and 'mel' layers in BufferWorkerConfig (App.tsx) from 120s to 1s, saving approximately 3.3MB of memory per worker instance. - Verified that existing tests pass. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Review Summary (Post r1→master merge)Status: ✅ MERGEABLE Changes: Two optimizations: 1. TranscriptionDisplay scrollingReplaces \MutationObserver\ with SolidJS \createEffect\ for auto-scrolling:
2. BufferWorker memory optimizationReduces unused buffer layer sizes from 120s to 1s:
Assessment: Both changes are well-motivated:
Recommendation: ✅ Merge — Good performance and idiomatic improvements |
Thank you for the review! I'm glad the changes align with the project's performance goals and idiomatic SolidJS usage. |
… BufferWorker - Replaced MutationObserver with SolidJS createEffect in TranscriptionDisplay.tsx to fix forced reflow issues and improve scrolling performance. - Reduced maxDurationSec for unused 'audio' and 'mel' layers in BufferWorkerConfig (App.tsx) from 120s to 1s, saving approximately 3.3MB of memory per worker instance. - Verified that existing tests pass. Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
LGTM. The replacement of MutationObserver with a reactive createEffect is highly idiomatic for SolidJS and avoids unnecessary DOM-level polling. The memory reduction in BufferWorker (from 120s to 1s for unused layers) is a significant win for low-end device performance. Recommend merging. |
|
Superseded by PR #134 which handles the display scrolling optimization more effectively using Solid primitives. |
This PR addresses performance issues related to scrolling in the transcript display and memory usage in the BufferWorker.
TranscriptionDisplay Optimization:
MutationObserverwas causing forced reflows by triggering layout reads/writes on every DOM mutation.createEffectthat tracksprops.confirmedTextandprops.pendingText. This ensures scrolling happens only when relevant data changes, andrequestAnimationFrameis still used to coalesce updates and prevent layout thrashing.BufferWorker Memory Reduction:
audioandmellayers inBufferWorkerare currently unused by the application logic (data flows directly viaMelWorkerandAudioEngine).maxDurationSecconfiguration inApp.tsxfrom 120s to 1s. This significantly reduces the memory allocated for these circular buffers (saving ~3.3MB) while keeping the layers registered to satisfy type constraints.TenVADWorkerClient Cleanup:
Tests passed successfully.
PR created automatically by Jules for task 13293483822858574319 started by @ysdede