Currently, we are scheduling independent tasks in a FIFO (in reality, whatever fibers scheduler does). This works great with the job-server protocol.
However, nothing prevents us from creating a priority queue internally. I think it would make sens to prioritize tasks based on their previous run time. The longest an item takes to build, the highest its priority is. This is called LPT.
We already track time for external invocations. We might as well track time for full build-request and associate the duration to the buildable in the cache, given us a priority number for the next run.
Currently, we are scheduling independent tasks in a FIFO (in reality, whatever fibers scheduler does). This works great with the job-server protocol.
However, nothing prevents us from creating a priority queue internally. I think it would make sens to prioritize tasks based on their previous run time. The longest an item takes to build, the highest its priority is. This is called [LPT](https://en.wikipedia.org/wiki/Longest-processing-time-first_scheduling).
We already track time for external invocations. We might as well track time for full build-request and associate the duration to the buildable in the cache, given us a priority number for the next run.