Skip to content

⚡ Bolt: Cache workspace static analysis scanner with WeakMap - #1

Merged
beingniloy merged 3 commits into
mainfrom
bolt-optimize-static-analysis-scan-10755583331390618455
Jul 17, 2026
Merged

⚡ Bolt: Cache workspace static analysis scanner with WeakMap#1
beingniloy merged 3 commits into
mainfrom
bolt-optimize-static-analysis-scan-10755583331390618455

Conversation

@beingniloy

Copy link
Copy Markdown
Owner

Implemented WeakMap-based caches for static analysis scans in FileSystemContext.tsx and BottomPanel.tsx.

Unmodified files in standard React immutable updates retain their object reference, allowing them to bypass the expensive scan logic (regex checks, string splitting) entirely. Modified files get new references and are automatically re-analyzed. The cache is automatically garbage-collected by the JS engine because it uses WeakMaps.

Tested and compiled locally without issues.


PR created automatically by Jules for task 10755583331390618455 started by @beingniloy

Optimize workspace static analysis parsing in FileSystemContext and BottomPanel.
By leveraging a WeakMap cache keyed on immutable FileSystemItem references, unmodified files are skipped during scanning. This avoids repetitive string splits and regex evaluations on keypresses and keeps the UI responsive in larger projects.

Co-authored-by: beingniloy <235952944+beingniloy@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules Bot and others added 2 commits July 17, 2026 11:04
Optimize workspace static analysis parsing in FileSystemContext and BottomPanel.
By leveraging a WeakMap cache keyed on immutable FileSystemItem references, unmodified files are skipped during scanning. This avoids repetitive string splits and regex evaluations on keypresses and keeps the UI responsive in larger projects.

Co-authored-by: beingniloy <235952944+beingniloy@users.noreply.github.com>
Optimize workspace static analysis parsing in FileSystemContext and BottomPanel.
By leveraging a WeakMap cache keyed on immutable FileSystemItem references, unmodified files are skipped during scanning. This avoids repetitive string splits and regex evaluations on keypresses and keeps the UI responsive in larger projects.

Co-authored-by: beingniloy <235952944+beingniloy@users.noreply.github.com>
@beingniloy
beingniloy merged commit ee9b04f into main Jul 17, 2026
3 of 4 checks passed
@beingniloy
beingniloy deleted the bolt-optimize-static-analysis-scan-10755583331390618455 branch July 17, 2026 19:59
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