Live data from Hacker News

Virtual DOM in Elm

elm-lang.org

1–10 of 117 posts

Re: Virtual DOM in Elm

#2
Elm looks extremely promising to me. However, I tried the Elm's implementation of TodoMVC here: http://evancz.github.io/TodoFRP/ and got an unusable list of strings with basically none of the features seen in other prototypes. Is it the one used in these benchmarks? What results would we see in an identical test?

Update: the benchmark uses a correct implementation available here: https://github.com/evancz/todomvc-perf-comparison/tree/maste... so it was a false alarm on my part. Tried it out at https://rawgit.com/evancz/todomvc-perf-comparison/master/tod...

Re: Virtual DOM in Elm

#3
post #2

Elm looks extremely promising to me. However, I tried the Elm's implementation of TodoMVC here: http://evancz.github.io/TodoFRP/ and got an unusable list of strings with basically none of the features seen in other prototypes. Is it the one used in these benchmarks? What results would we see in an identical test? Update: the benchmark uses a correct implementation available here: https://github.com/evancz/todomvc-per…

I think this is the version they were referring to: http://evancz.github.io/elm-todomvc/

Re: Virtual DOM in Elm

#4
post #2

Elm looks extremely promising to me. However, I tried the Elm's implementation of TodoMVC here: http://evancz.github.io/TodoFRP/ and got an unusable list of strings with basically none of the features seen in other prototypes. Is it the one used in these benchmarks? What results would we see in an identical test? Update: the benchmark uses a correct implementation available here: https://github.com/evancz/todomvc-per…

I think you may have gone to the wrong address. The second link in the article is the most recent implementation (using a virtual DOM)

http://evancz.github.io/elm-todomvc/

Re: Virtual DOM in Elm

#5
post #2

Elm looks extremely promising to me. However, I tried the Elm's implementation of TodoMVC here: http://evancz.github.io/TodoFRP/ and got an unusable list of strings with basically none of the features seen in other prototypes. Is it the one used in these benchmarks? What results would we see in an identical test? Update: the benchmark uses a correct implementation available here: https://github.com/evancz/todomvc-per…

I assume it was http://evancz.github.io/elm-todomvc/, which is more recently updated and seems identical to the other TodoMVC demos.

Re: Virtual DOM in Elm

#6
This technique may be the most revolutionary thing in web development in the last several years, IMHO. I've been using React for a while, and starting to integrate Mori for persistent data structures, and the things I can do with it is insane. The fact that it's not only far better performant, but a way better abstraction for dealing with UIs, is crazy.

Re: Virtual DOM in Elm

#7
My first thought when looking at the benchmarks is that I find it strange that Backbone is faster than React. Not that I imagine Backbone to be slow, particularly, just that this article is about one of React's key features - the virtual DOM - and that's something which Backbone doesn't have. I'd expect to see React up there with Om, Mercury & Elm.

I've just had a look at the code and React is using a localstorage backend, while Backbone is using its models + collections with a localstorage extension... so I'd expect there to at least be some overhead there, but apparently not.

Does anyone have any quick thoughts on what might be happening here? I can't shake the feeling that these benchmarks might not be terribly useful.

Re: Virtual DOM in Elm

#8

My first thought when looking at the benchmarks is that I find it strange that Backbone is faster than React. Not that I imagine Backbone to be slow, particularly, just that this article is about one of React's key features - the virtual DOM - and that's something which Backbone doesn't have. I'd expect to see React up there with Om, Mercury & Elm. I've just had a look at the code and React is using a localstorage ba…

I've seen some AngularJS vs React benchmarks a while back. I believe it was http://jsperf.com/angular-vs-react/5

I consistently got the result of Angular utterly and completely destroying React. Initially I blamed the virtual DOM approach, but after seeing other frameworks utilizing it and outperforming Angular by a huge margin, it seems to me that React is not written for performing well on small DOM documents. (There might be a turning point, considering how bloated Facebook pages it was designed for.)

Re: Virtual DOM in Elm

#9
post #8

My first thought when looking at the benchmarks is that I find it strange that Backbone is faster than React. Not that I imagine Backbone to be slow, particularly, just that this article is about one of React's key features - the virtual DOM - and that's something which Backbone doesn't have. I'd expect to see React up there with Om, Mercury & Elm. I've just had a look at the code and React is using a localstorage ba…

I've seen some AngularJS vs React benchmarks a while back. I believe it was http://jsperf.com/angular-vs-react/5 I consistently got the result of Angular utterly and completely destroying React. Initially I blamed the virtual DOM approach, but after seeing other frameworks utilizing it and outperforming Angular by a huge margin, it seems to me that React is not written for performing well on small DOM documents. (The…

Our performance benchmarks suggest that application performance is most certainly better off with: (a) DOM reuse (b) calculating expensive things only once (c) reducing GC pressure == not discarding/recreating things (d) coordinating actions that may trigger reflow. It is independent of what framework you are using.

My limited understanding of React is that it fails in (a), (b) and (c), and only limited measures can be applied to improve them. Re-creating the entire DOM on each update probably does not help. I have no information if (d) is possible with it.

I am using Angular.dart for a while now, and it can be used to get all of them in an optimal way.

Disclaimer: I'm working at Google.

Re: Virtual DOM in Elm

#10

This technique may be the most revolutionary thing in web development in the last several years, IMHO. I've been using React for a while, and starting to integrate Mori for persistent data structures, and the things I can do with it is insane. The fact that it's not only far better performant, but a way better abstraction for dealing with UIs, is crazy.

Do you have any code samples online of this combination? I'd be interested to see how these are used together, because they seem like a great fit.
Post reply on HN