`lake` should prioritize files with deeper dependencies
Nobody has claimed this yet.
- Dominant language
- Lean
- Stars
- 9.2k
- Forks
- 990
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 175
Description
Currently when building Mathlib we spend most of the build maxing out CPUs (at least at 24 cores), but there are at least several minutes at the end when we are using fewer.
We could easily avoid this: prioritize tasks according to the depth of downstream dependencies. In particular, this would keep a "pool" of leaf files available to run only when there are spare CPUs, and should ensure full parallelism until the very end.
This costs minutes of time (or at least, extra context switching) every time I am working on Mathlib in a way that requires full builds, and I'm sure it would improve life for many others as well (as well as CI responsiveness).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by examining lake's build-task scheduling and dependency handling, since the issue names no specific files or tests. The change should prioritize tasks with deeper downstream dependencies, reserve leaf files for spare CPUs, and preserve full parallelism until the build is nearly complete.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100