Skip to content

⚡ Bolt: Fix serialized actor bottlenecks in parallel scanners#31

Open
acebytes wants to merge 1 commit intomainfrom
bolt-parallel-scanners-6796066008954764646
Open

⚡ Bolt: Fix serialized actor bottlenecks in parallel scanners#31
acebytes wants to merge 1 commit intomainfrom
bolt-parallel-scanners-6796066008954764646

Conversation

@acebytes
Copy link
Copy Markdown
Contributor

💡 What: Converted CacheScanner and NodeModulesScanner from actor to struct and made their internal methods synchronous without actor isolation.

🎯 Why: While both scanners used withTaskGroup to attempt parallel directory traversal across multiple CPU cores, their actor isolation forced the child tasks to jump back to the actor's serialized execution context to perform the actual synchronous file I/O. This effectively serialized all the disk scanning operations, running them one by one. Since neither scanner maintains mutable state and FileManager.default is thread-safe for these operations, converting to struct allows the child tasks to truly run in parallel.

📊 Impact: Significantly improves scanning speed, especially for developers with many node_modules folders or large caches, by utilizing all available CPU cores for disk traversal rather than serializing them on a single actor.

🔬 Measurement: Profile the application before and after. Notice that CPU core utilization spikes to 100% across multiple cores during a scan, whereas previously it would be constrained. Scanning large directories like ~/.npm and recursive node_modules will complete visibly faster.


PR created automatically by Jules for task 6796066008954764646 started by @acebytes

Co-authored-by: acebytes <2820910+acebytes@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.

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