Fix memory leak, reduce I/O, parallelize extensions, add code splitting + mimalloc + LTO#532
Merged
mehmetozguldev merged 3 commits intoFeb 18, 2026
Conversation
…ng + mimalloc + LTO - plug unbounded Map growth in app-store (lastBufferContent/historyDebounceTimers never cleared on buffer close) - debounce saveSessionToStore so closing 10 tabs = 1 disk write instead of 10 - extensions load in parallel via Promise.allSettled instead of sequential await loop - lazy-load 9 heavy components (terminal, sqlite viewer, diff viewer, PR viewer, image/pdf/web viewer, agent tab, external editor) + UpdateDialog - add mimalloc as global allocator (~2x faster small allocs vs default Windows heap) - add lto="thin" + codegen-units=1 for release builds (~5-8% runtime gain)
mehmetozguldev
approved these changes
Feb 18, 2026
Member
mehmetozguldev
left a comment
There was a problem hiding this comment.
Reviewed and verified locally after the latest update. CI formatting issues are fixed, and the performance-focused changes look good to merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what this does
6 performance fixes, all verified against the actual codebase. no speculative stuff.
memory leak —
lastBufferContentandhistoryDebounceTimersin app-store are module-level Maps that grow every time a buffer opens but never shrink when it closes. added a cleanup function that gets called incloseBufferForce.debounce disk writes —
saveSessionToStoregets called 6 different places across buffer operations. closing 10 tabs = 10 synchronous writes. wrapped it in a 300ms debounce so it batches into 1.parallel extension loading — extensions were loading in a sequential
for...awaitloop. switched toPromise.allSettledso they all load at once. one failing extension no longer blocks the rest either.code splitting — 9 heavy components in pane-container (terminal, sqlite viewer, diff viewer, PR viewer, image/pdf/web viewer, agent tab, external editor) and UpdateDialog in App.tsx were eagerly imported. converted to
React.lazy+Suspenseso they only load when actually needed.mimalloc — added as global allocator. the default Windows heap is slow for the small frequent allocations rust does. mimalloc is purpose-built for this.
LTO + codegen-units — added
lto="thin"andcodegen-units=1to release profile. lets LLVM optimize across crate boundaries and produce tighter binaries.files changed
src/stores/app-store.ts— export cleanup function for buffer history trackingsrc/features/editor/stores/buffer-store.ts— debounce wrapper + cleanup call on closesrc/extensions/loader/extension-loader.ts— Promise.allSettledCargo.toml— release profilesrc-tauri/Cargo.toml— mimalloc depsrc-tauri/src/main.rs— global allocatorsrc/App.tsx— lazy UpdateDialogsrc/features/panes/components/pane-container.tsx— lazy 9 components + Suspensetypecheck passes clean.