⚡ Bolt: Cache workspace static analysis scanner with WeakMap - #1
Conversation
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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
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>
Implemented WeakMap-based caches for static analysis scans in
FileSystemContext.tsxandBottomPanel.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