facebook/react — pull request #1550 by syranide (2014-05-17 22:09:45+00:00)
Title: Immediately prime node cache with inserted elements, rather than lazily

Results from initial commit: Chrome: http://i.imgur.com/zaCbEqk.png, IE11: http://i.imgur.com/bE07gaR.png, IE9: http://i.imgur.com/p9vShN9.png, http://i.imgur.com/t0zz7oh.png

Immediately this meant we could ditch some complicated code in favor of one very simple function for priming the cache, which I assume is also part of the reason why this generally seems to improve performance. Traversing the inserted nodes is really cheap, which means it shouldn't measurably affect initial rendering, and pales in comparison to everything else, whereas doing it lazily introduces a lot of overhead.

```
raw gz Compared to master @ 46de927a28eb788b4329589658dbd31a014e4edd
-2337 -780 build/react-with-addons.js
-297 -124 build/react-with-addons.min.js
-2337 -764 build/react.js
-296 -116 build/react.min.js
```

While this is neat, I think the real potential here is the next step of not having to maintain `nodeCache` at all. Hopefully also being able to ditch React ID as well in-favor of operating directly on the ReactDOMComponents, thus ditching `putListeners` too and simply querying the actual DOM components.