sbt/sbt — pull request #1631 by eed3si9n (2014-09-29 21:49:16+00:00)
Title: Cached resolution (minigraph caching)

Consolidated resolution proved that ultimately avoiding work by caching is going to be faster than trying to all the work efficiently. The resolution prototype gave me in-depth knowledge of how Ivy resolution is implemented, as well as where the current bottlenecks are. One of the things I learned is that dependency graphs can be stitched together relatively easily.

Instead of creating an artificial graph for unique subprojects, cached resolution creates an artificial dependency graph for each direct dependency of a subproject. I'm calling them a minigraph. Minigraphs can expand to dozens of modules using stock resolution algorithm, and then saved to individual json files. Finally, these minigraphs are stitched together using the conflict resolver built into Ivy.

![cached-resolution](https://gist.github.com/eed3si9n/fc8f2cb5d489edf94ebe/raw/a8576f17c0906d5e13fa50e565dcc4e149c26aff/cached-resolution.png)

To make sure that dynamic revisions (such as -SNAPSHOT) are handled correctly, sbt will keep an internal logical clock, which will be incremented when the user issues a command. Also these minigraphs are shared across different builds.