perf(v8): reduce heap limits and remove optimize-for-size#4369
Merged
gregpriday merged 1 commit intodevelopfrom Mar 28, 2026
Merged
perf(v8): reduce heap limits and remove optimize-for-size#4369gregpriday merged 1 commit intodevelopfrom
gregpriday merged 1 commit intodevelopfrom
Conversation
- Renderer: 4096→1536 MB old-space, add --max-semi-space-size=64, remove --optimize-for-size
- Main process: remove nodeV8.setFlagsFromString("--optimize_for_size")
- PTY host: reduce default memoryLimitMb from 4096 to 512
- Update environment test to assert --optimize_for_size is no longer set
- Add PtyClient tests for default and custom memory limits
f36101c to
9c21f17
Compare
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.
Summary
--max-semi-space-size=64to encourage earlier minor GC on short-lived React/Zustand allocations--optimize-for-sizefrom both the renderer (js-flagsinmain.ts) and the main process (v8.setFlagsFromStringinenvironment.ts) — this flag degrades JIT throughput and was designed for embedded environments, not desktop IDEsResolves #4364
Changes
electron/main.ts— updatedjs-flagsswitch: 1536 MB heap, added semi-space 64 MB, dropped--optimize-for-sizeelectron/services/PtyClient.ts—memoryLimitMbreduced from 4096 to 512electron/setup/environment.ts— removedv8.setFlagsFromString('--optimize_for_size')and the now-unusedv8importelectron/setup/__tests__/environment.test.ts— updated test to confirm the flag is no longer setelectron/services/__tests__/PtyClient.handshake.test.ts— added test verifying the pty-host memory limit is 512 MBTesting
npm run checkpasses clean (typecheck, lint, format)