Performance difference between Om and Reagent's ToDO MVC exampls

1,061 views
Skip to first unread message

Michiel Borkent

unread,
Oct 27, 2014, 8:48:59 AM10/27/14
to clojur...@googlegroups.com
I just asked this in #clojurescript, but it might be interesting to discuss here.

How come the Reagent Todo MVC example doesn't feel as snappy as the Om version,
or the vanilla JS version for that matter. Om feels closer to the vanilla implementation.

Compare these two

http://holmsand.github.io/reagent/

http://swannodette.github.io/todomvc/labs/architecture-examples/om/

by adding a couple of items very quickly.

Could it be the Reagent example was based on Reagent without batching with requestAnimationFrame?
I can't find where the original sources for these pages are.

Will the examples be hosted on the pages for "reagent-project"?

Kind regards,

Michiel

Rory Douglas

unread,
Oct 28, 2014, 7:35:15 AM10/28/14
to clojur...@googlegroups.com
I didn't personally notice much difference, but here are a few observations:

1) Using the React Chrome Extension, you can see the overall React component tree is much bigger/deeper on the Reagent page, since the entire page is composed of nested React components.

2) I also noticed this in comparing Om vs Reagent for my own top app: every [:div] in Reagent appears to be a component (at least in the React Chrome Extension tree), whereas that's not the case for each Om (dom/div) i.e.

Om:

<SomeComponent>
<div class="bob">
<li>....etc

Reagent:

<SomeComponent>
<:div.bob>
<div class="bob">
<:li>
<li>

I'm not sure if this is just an artifact of how the Chrome Extension renders things, or if there are 2x as many components in a Reagent tree vs Om. If there were, I would suppose that would penalize virtual DOM diffing in Reagent ever so slightly.

Robin Heggelund Hansen

unread,
Nov 11, 2014, 10:32:08 AM11/11/14
to clojur...@googlegroups.com
Posted this question on the official bug tracker, you can see the response from Dan Holmsand (lead dev) there.

Robin Heggelund Hansen

unread,
Nov 11, 2014, 10:32:39 AM11/11/14
to clojur...@googlegroups.com

Michiel Borkent

unread,
Nov 11, 2014, 10:35:55 AM11/11/14
to clojur...@googlegroups.com
A lot better now.
> --
> Note that posts from new members are moderated - please be patient with your first post.
> ---
> You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/sWJxg-2cahQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
> To post to this group, send email to clojur...@googlegroups.com.
> Visit this group at http://groups.google.com/group/clojurescript.



--
http://www.michielborkent.nl
http://www.eetvoorjeleven.nu
Reply all
Reply to author
Forward
0 new messages