Om is fast at checking if a component's state has changed because you can do a very fast identity comparison on the persistent hash map holding state, but persistent data structures are not faster than their mutable cousins simply because of immutability. That immutability leads to significantly more objects being allocated, which means to really take advantage of these features in a managed language you need a VM with a very high performance garbage collector. This is partly why Clojure on the JVM works so well. That being said, non JIT compiled JavaScript VMs generally provide terrible performance for ClojureScript. I do not believe JavaScriptCore JITs anything, so I don't know how immediately useful ClojureScript with React Native will be outside of toy examples.
> That immutability leads to significantly more objects being allocated
What about shared immutable data structures?
Re:First Impressions Using React Native
by tree_of_item on Saturday February 07, 2015 @01:05AM
(#9013245)
Clojure uses structural sharing of course, but that was taken in to account in the parent comment. It's still a lot of allocation.
Re:First Impressions Using React Native
by danabramov on Friday February 06, 2015 @12:40PM
(#9010261)
Fair points.
Re:First Impressions Using React Native
by saosebastiao on Friday February 06, 2015 @12:09PM
(#9009990)
I like Clojurescript in general, but the code bloat problems and runtime speed problems still exist even with advanced optimizations. The big problem is that you have to use code that is Closure-compatible. If it isn't, there are hacks to make it work, but you end up killing the ability to remove dead code. And no matter what, you are going to end up shipping portions of the Clojure code as a runtime within the javascript runtime.
I have used cljs for non-mobile web interfaces, but the performance of Om in Phonegap on mobile hardware was terrible enough that I scrapped it for Xamarin.
>bloated code sizes, interop issues, poor runtime performance, etc
I've heard about no such problems about ClojureScript. In fact there's less code size than you'd usually have because Google Closure Compiler advanced more works with it out of the box[2]. It's also fast because immutability.
[1]: https://github.com/omcljs/om
[2]: http://swannodette.github.io/2015/01/06/the-false-promise-of...