[engine] Rule Graph construction perf improvements
Review Request #4281 — Created Oct. 5, 2016 and submitted
|kwlzn, stuhood, yujiec|
This follows up https://rbcommons.com/s/twitter/r/4251/, cleaning up the perf todos.
It passes through the full graph construction's intermediate states so that they can short circuit subsequent subgraph constructions.
It also moves transitive unfulfillable rule elimination so that it happens once for both full graph and subgraph instead of once per construction.
There's also a bug fix in RuleEdges matching, which was caused by matching being overly broad.
Ran engine tests locally. CI passed at https://travis-ci.org/pantsbuild/pants/builds/165317483