On Mon, Jan 27, 2014 at 12:48 PM, Mike Haney <txmikes...@gmail.com> wrote:

> I was initially surprised by the implementation in your tutorial using
> multimethods instead of protocols, especially since you are only
> dispatching on a single function.  But as I thought about it more, I
> realized this could be a perfect place for multiple dispatch, i.e. swapping
> components based on multiple pieces of application state.  Powerful stuff!
>

The problem with protocols is that they are type directed - I think for
most user interfaces you want something data directed.

One question - I've tended to shy away from multimethods because of the
> performance hit, but this is a compelling case for their usage.  Just how
> big of a performance hit are we talking about, compared to protocols or
> regular function invocation?


Multimethods are probably 4X-5X slower in ClojureScript then they should
be. I'll probably be looking into optimizing them in the near future.
However using them with Om is fine since they aren't really part of the
inner loop - all the time is going to be spent in React, not your
ClojureScript.

David

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to