Repository navigation
Conversation
Each free partition gets the first dependency whose children have compiled. Sort the dependencies once by the length of their longest chain of dependents, so the start of a long chain does not wait behind dependencies nothing depends on. Ties keep the topological order. Assisted-by: Claude Code:claude-opus-5-5 Signed-off-by: Pablo Margreff <pmargreff@gmail.com>
Member
|
Merged locally, pushing soon, thank you!!! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
MIX_OS_DEPS_COMPILE_PARTITION_COUNT, each free partition gets the first dependency, in converger order, whose children have compiled. The converger order says nothing about how much work comes after each dependency, so the start of a long chain can wait behind small dependencies that nothing depends on. Near the end of the build, the other partitions then have nothing to compile while that chain compiles on one of them, and the CPU sits idle.This PR sorts the dependencies by the length of their longest chain of dependents, so the start of a long chain is sent first.
It replaces #16171, which sorted by source size, following the discussion there: chain length is as fast and simpler. Across nine projects at 2 to 12 partitions, builds take 4.0% less time than
main(1.0% less than with source size). The full results, charts and the comparison with the other orders are in this comment, and the benchmark script, data and notebooks in https://github.com/pmargreff/mix-deps-partition-benchmark.CPU idle (chart)
AI disclosure
I used Claude Code (Claude Opus 5.5) to write the change and its tests and to run the benchmarks. I reviewed and validated the code and the results myself.