Hi Roman,

Thanks for putting together the benchmark! It turned out to be a good test for 
a worst-case scenario for Reagent, and helped me figure out that 
clojure.core/memoize is very, very, very slow :)

So Reagent 0.4.2 now gives this with your benchmark:

{:crate 5.426333333333332, :reagent 2.016666666666667, :react 
1.1293333333333333, :jquery 2.666, :dommy 1.6596666666666666, :sablono 
1.0986666666666667, :dommy-compiled 0.531}

However, it has to be said that this is a quite unrealistic benchmark. It 
basically shows how fast a browser can create parts of the dom that are never 
actually rendered. 

If you would actually show all 10000 items of the <ul/> in the benchmark in a 
real browser, it would take something like 10 seconds, making pretty much any 
difference in processing time between different approaches irrelevant (apart 
from being a pretty lousy user experience...).

So, even if Reagent now is twice as fast in your benchmark as before, I haven't 
been able to come up with any real-world example where that difference is even 
noticeable - the browser's rendering time always dominates, and drowns out 
almost anything you can do in javascript (as long as you don't trigger 
repaints, of course).

My guess is that the worst case overhead for Reagent (in comparison with 
hand-written React code) in a real browser is something like 10% for the first 
render, which is (I think) quite a small price to pay for the warm fuzzy 
feeling of getting to deal only with immutable Clojure data structures all the 
way down.

For subsequent renders (which is where performance usually matters, i.e if you 
have a frequently changing UI), Reagent should be quite a bit faster than plain 
React most of the time.

/dan


On 5 mar 2014, at 10:29, Roman Scherer <roman.sche...@burningswell.com> wrote:
> I'm the author of Sablono. I'm not sure if this is still true,
> but sablono is a compiler and interpreter. That means it tries to
> compile as much as it can at "compile time", which speeds up
> rendering. The sablono tests contain a benchmark namespace that
> run a test suite I copied from dommy against some templating
> systems. I use them to make sure I don't mess anything up while
> adding new features. Thos are the results:
> 
> {:react 1.33, :dommy-compiled 0.458, :jquery 2.6916666666666664, :dommy 
> 1.4056666666666666, :reagent 4.13, :sablono 1.3716666666666668, :crate 
> 5.7459999999999996}

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to