On Tue, Dec 7, 2010 at 3:31 AM, Tobias Raeder
<tobias.rae...@googlemail.com> wrote:
> Just checking performance versus the version i have been using i
> noticed quite a difference
>
> For 100000 runs over a small 10 key/value map
> (defn fmap [keyf valf m]
>  (into {}
>    (for [[k v] m]
>      [(keyf k) (valf v)])))
> 550ms
>
> (defn fmap2 [keyf valf m]
>  (-> (fn [inputmap [k v]]
>      (assoc inputmap (name k) (inc v)))
>    (reduce {} inputmap)))
> 250ms

Does the speed difference persist if you fix the bugs in the second version? :)

-- 
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