Open ndmitchell opened 8 years ago
A question about critical path: Does shake use critical path analysis to decide which task to run next (on parallel builds)? In some cases this could drastically reduce build time. Actually, an optimal scheduling policy needs to do critical chain analysis (taking resources into account). This is only partially reflected in critical path analysis if time waiting for a resource is modeled as an explicit step.
Another way to minimize build time is to try to rebuild a failing step as soon as possible (for example, when modifying a header file to fix a compilation error in one of the many source files that include it). This way, if the fix did not work, the build would fail much faster, reducing the edit/compile cycle time. I think Ninja has this feature...
Shake doesn't do critical path analysis - the idea is that most build steps should be relatively quick so it isn't as important. That said, it's certainly possible, and might provide some benefit, particularly for certain workloads.
Rerunning error states is also possible, and probably more of an immediate benefit for users. Again, not implemented yet. I wasn't aware of Ninja having that feature, but if it is mostly deterministic it might look like it does.
It now has both critical path with speculative and precise modes. This was a deeper topic than I thought!
There should be a mode that gives you the longest path through the build system.