Skip to content

⚡ Bolt: Implement dynamic concurrency in SharedDownloadQueue - #18

Merged
alexey1312 merged 2 commits into
mainfrom
bolt/dynamic-concurrency-shared-queue-16895614716975194817
Dec 27, 2025
Merged

⚡ Bolt: Implement dynamic concurrency in SharedDownloadQueue#18
alexey1312 merged 2 commits into
mainfrom
bolt/dynamic-concurrency-shared-queue-16895614716975194817

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

⚡ Bolt: Implement dynamic concurrency in SharedDownloadQueue

💡 What:
Implemented dynamic concurrency adjustment in SharedDownloadQueue.downloadFiles. Instead of a fixed 1-in-1-out loop, we now check available slots after each download completes and spawn multiple tasks if capacity permits.

🎯 Why:
To prevent resource underutilization. When multiple jobs run, or when one job finishes, remaining jobs were stuck at their initial concurrency level even if global slots became available. This change allows jobs to "burst" into available slots, maximizing throughput.

📊 Impact:

  • Improves throughput in batch mode when processing multiple configs with varying file counts.
  • Ensures maxConcurrentDownloads is fully utilized.
  • Prevents starvation of small jobs if large jobs hog slots (though prioritization handles order, this handles slot filling).

🔬 Measurement:
Verified with SharedDownloadQueueTests. While direct performance benchmarking requires a real network/Figma environment, the logic change ensures activeDownloadCount tends towards maxConcurrentDownloads more aggressively.


PR created automatically by Jules for task 16895614716975194817 started by @alexey1312

Previously, SharedDownloadQueue would determine the concurrency level for a job at the start and maintain it throughout the job's lifecycle. If slots became available (e.g., another job finished), the running job would not scale up to utilize them. Conversely, if oversubscribed, it would not shed load effectively.

This change introduces dynamic concurrency adjustment:
- Inside the download loop, we now check `activeDownloadCount` against `maxConcurrentDownloads`.
- If slots are available, we spawn additional tasks to fill them.
- If we are oversubscribed, we naturally reduce concurrency by not replacing finished tasks (unless necessary to keep the job alive).

This ensures better utilization of the download queue in batch processing scenarios.
@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 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!


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

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

@alexey1312
alexey1312 marked this pull request as ready for review December 27, 2025 15:48
@alexey1312
alexey1312 merged commit 7f79d74 into main Dec 27, 2025
3 checks passed
@alexey1312
alexey1312 deleted the bolt/dynamic-concurrency-shared-queue-16895614716975194817 branch December 27, 2025 15:48
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