Skip to content

perf: increase the default network concurrency on machines with many CPU cores#10215

Merged
zkochan merged 3 commits intomainfrom
network-concurrency2
Nov 21, 2025
Merged

perf: increase the default network concurrency on machines with many CPU cores#10215
zkochan merged 3 commits intomainfrom
network-concurrency2

Conversation

@zkochan
Copy link
Copy Markdown
Member

@zkochan zkochan commented Nov 20, 2025

close #10068

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR optimizes network concurrency for machines with many CPU cores by replacing a simple CPU-based calculation with a worker-based scaling approach. The change exports the calcMaxWorkers() function from the worker module and uses it to compute network concurrency as a multiple of available workers, bounded between 16 and 64.

  • Exports calcMaxWorkers() from the worker module to make it reusable across packages
  • Updates network concurrency calculation to scale with worker count (3x workers, min 16, max 64)
  • Removes the direct dependency on os module in package-requester

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
worker/src/index.ts Exports calcMaxWorkers() function with explicit return type to enable reuse in other packages
pkg-manager/package-requester/src/packageRequester.ts Replaces CPU-based network concurrency calculation with worker-based scaling (3x workers, bounded 16-64) and removes unused os import
.changeset/small-results-hunt.md Documents the network concurrency improvement as a minor version change

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@zkochan zkochan requested a review from a team November 20, 2025 23:54
@zkochan zkochan merged commit 4893853 into main Nov 21, 2025
11 of 13 checks passed
@zkochan zkochan deleted the network-concurrency2 branch November 21, 2025 14:29
zkochan added a commit that referenced this pull request Nov 22, 2025
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.

Increase default network-concurrency

4 participants