On Thu, May 12, 2011 at 10:26 PM, Brent Millare <brent.mill...@gmail.com>wrote:

> Hey,
>
> Can you give a simple explanation how your methods would be faster
> than multimethods. Does this mean your implementation uses protocols
> underneath? How does multimethods work? How many branches?
>
> -Brent
>

There's quite a bit of overhead in the current implementation of
multimethods:

- dispatch fn
- in order to deal w/ complex matches dispatch fn must construct a
collection
- this collection is looked up in map
- if not found check to see that if it's been memoized
- if not memoized check to figure out if it matches an entry in the map
- when found memoize

In the implementation I'm proposing we only do the following:

- literal matches are dealt with case
- instance? or custom predicate matches done w/ if

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