Shopify/batman — pull request #706 by hornairs (2013-05-09 20:08:57+00:00)
Title: Query selector traversals

@ibawt @nickjs @kristianpd

This builds on top of #705 switching us to synchronous (kindof) rendering since I think thats the way we should go and I want to show the combination speed increases.

This switches the `Batman.DOM.willInsertNode` traversals which fire events on views and do other stuff to use `querySelectorAll` to grab an array of nodes to do work on, instead of recursing node by node down the tree. It seems to be somewhat faster in some browsers: find master in the dark blue, `synchronous_rendering` in the light blue, and this branch (`query_selector_traversals`) in the orange.

![screen shot 2013-05-09 at 3 48 08 pm](https://f.cloud.github.com/assets/158950/484866/f9307152-b8e3-11e2-9fee-653324602940.png)
![screen shot 2013-05-09 at 3 47 59 pm](https://f.cloud.github.com/assets/158950/484867/f93a8976-b8e3-11e2-8657-d733e4ff1851.png)
![screen shot 2013-05-09 at 3 47 52 pm](https://f.cloud.github.com/assets/158950/484868/f93d4e90-b8e3-11e2-92d8-63227db04f18.png)

I think that the browsers for which this doesn't show any improvement are just really good at minimizing function call overhead, and for the browsers which don't show that big an improvement it might be that the portion of time spent in these functions is minimal so changing them to be faster doesn't show much improvement in the overall loop rendering benchmarks.

Whatcha think?