4 ms·
I'm not great at reading ClojureScript - but I'd really like to port some of the optimizations from Om, such as the rendering on requestAnimationFrame and usage
by STRML 13y ago
I'm not great at reading ClojureScript - but I'd really like to port some of the optimizations from Om, such as the rendering on requestAnimationFrame and usage of shouldComponentUpdate to Backbone.LayoutManager[1]. Swannodette, if you're around, do you have a minute to give a more in-depth explanation of how that works?
1. https://github.com/tbranyen/backbone.layoutmanager/wiki https://github.com/tbranyen/backbone.layoutmanager/wiki
- swannodette 13y agoIf you're using Backbone.js I would just rely on React to deliver the requestAnimationFrame enhancement. As far as shouldComponentUpdate, just make your component implement a better one. To be honest at this point there is little that Om does over React other than provide really good defaults ;)
- STRML 13y agoThanks for the input. I'll look into it. We've been talking a bit about doing a more general rewrite of LM and I've been looking for ideas that would make it worthwhile (not just cleaner code, but better perf or features). This might be one of them.
- d_j_s 13y agoThe requestAnimationFrame part with simple backbone views is pretty straight forward: https://github.com/danshearmur/backbone-fast-view/blob/master/backbone.fast-view.js https://github.com/danshearmur/backbone-fast-view/blob/maste... I'm sure doing a similar thing with LayoutManager wouldn't be too hard. I think LayoutManager uses _render internally too so you may want to call it something else. It also definitely does make the benchmarks faster http://danshearmur.github.io/backbone-fast-view/ http://danshearmur.github.io/backbone-fast-view/
- STRML 13y agoThat's great - benchmark 2 is essentially a bunch of useless work, and it appears to really speed things up by making sure we only actually touch the DOM every 16ms, instead of constantly. I'd imagine a Backbone integration with React would get us even closer. I'm not sure if it actually makes sense to go too far with an LM conversion as React appears to do a better job. But LM could certainly benefit from waiting until RAF.