Skip to content →

Efficiency of Clojure’s built-in set operations

If you’re using Clojure’s built-in set operations, clojure.set/union/intersection/difference, you should be aware that their speed currently depends (sometimes dramatically) on the order of the arguments given. And, since clojure.set/difference is not commutative, it is simply needlessly slow if the second set is larger than the first.

… [truncated] …

Update : This post is no longer relevant, since my faster (+ multi-argument) versions are now included in clojure.set.

Published in Clojure


Leave a Reply

Your email address will not be published. Required fields are marked *