square/dagger — pull request #373 by cgruber (2014-01-10 19:19:37+00:00)
Title: Improve performance of .plus() under large volumes of contributed SetBindings. 

Chain (instead of copy-construct) SetBindings. Also, extract a BindingsGroup that treats SetBindings as first-class and sets them aside. This reduces the amount of scanning we have to do on plus(), since large graphs repeatedly instantiated (say, per request) build up a lot of overhead for each scan

This requires a breaking change in the code-generation of ModuleAdapter subclasses such that they take BindingGroup instead of Map> and call the right method. The call out allows for no extra work to be done to track the set bindings and keep them for fast use in .plus().

In internal testing at Google, with large (500+) numbers of set-bindings contributions and a .plus() per server request, we shaved off 2% of request latency with this change as compared to the previous fix to Setbindings. YMM.

This change also adds some refactoring of the internals - a bit of clean-up which needs to be completed in another pull.