Skip to content

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Sep 22, 2025

Until we have better measurements that would motivate a different batching strategy, copying the driver’s batch size seems like the most reasonable thing to do.

@ahoppen
Copy link
Member Author

ahoppen commented Sep 22, 2025

@swift-ci Please test

ahoppen added a commit to ahoppen/sourcekit-lsp that referenced this pull request Sep 22, 2025
… use-cases

According to https://developer.apple.com/documentation/foundation/processinfo/activeprocessorcount

> Whereas the processorCount property reports the number of advertised processing cores, the activeProcessorCount property reflects the actual number of active processing cores on the system. There are a number of different factors that may cause a core to not be active, including boot arguments, thermal throttling, or a manufacturing defect.

For short-lived workloads like `concurrentMap` we want to parallelize across the number of cores that are currently active, so use `activeProcessorCount` instead. The only case where we want to continue using `processorCount` is the computation of concurrent tasks for `TaskScheduler` because the value is stored for the lifetime of the SourceKit-LSP process and we don’t want to limit parallelism if SourceKit-LSP was launched during a time of thermal throttling.

I stumbled across this while working on swiftlang#2302
Until we have better measurements that would motivate a different batching strategy, copying the driver’s batch size seems like the most reasonable thing to do.
@ahoppen ahoppen force-pushed the multi-file-indexing-batch-size branch from ec95684 to 05c04de Compare September 22, 2025 07:52
@ahoppen
Copy link
Member Author

ahoppen commented Sep 22, 2025

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Sep 22, 2025

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 32e919c into swiftlang:main Sep 23, 2025
3 checks passed
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.

2 participants