On May 9, 12:09 am, David Nolen <dnolen.li...@gmail.com> wrote:
> On Sun, May 8, 2011 at 4:43 PM, Dmitry Kakurin 
> <dmitry.kaku...@gmail.com>wrote:
>
> > Very well, something along these lines would be my guess too.
> > But that would mean that in case 2 protocols are no faster
> > than multimethods.

They are much faster than multimethods because you know up front that
dispatch is on the type of the first argument.

>
> Not true.
>
> > And I've got an impression that protocols are described to be as fast as
> > interface dispatch (callvirt).

Almost as fast in case one. There is an indirection because of
dispatch.

> > So either my impression is wrong (which is totally possible) or there is
> > some clever trick available on JVM to do case 2 below faster.
> > That's why I'm asking.
>
 And yes, there is a difference in performance if you extend after you
define your type.


To get accurate we need Rich, here.

> They are not as fast, but they are quite fast. Look at the implementation.
>
> 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

Reply via email to