Re: Merge optimization question

2015-06-11 Thread Mohit Thatte
Hi Leon, If you use merge a lot, check out data.int-map , it only supports integer keys, but is optimized for merges. Merge is essentially (reduce conj) so you could see if using a transient version of the original map and m

Re: Merge optimization question

2015-06-11 Thread Matching Socks
(keys old-map) might not be in the same order as (keys new-map). The every? check is almost right but the test will be false where new-map's value is falsey. You could use (set (keys new-map)). -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Merge optimization question

2015-06-11 Thread Leon Grapenthin
If I want merge in an algorithm where it is often the case that the new map has the same keys as the old map, I'd assume using the new map as a replacement is faster in those cases. Of course comparing the keys costs and I'd like to know which is the fastest way. Can I do (= (keys old-map) (ke