Extreme Cleverness: Functional Data Structures in Scala

Sign up for weekly Clojure tips, software design, and a Clojure coding challenge.

Reference: Extreme Cleverness: Functional Data Structures in Scala

According to Daniel Spiewak, Clojure's vec requires, in the worst case, 7 array accesses and 14 bit operations.

On really large datasets—this just astonished me when I discovered it—on really large datasets this data structure [Clojure vec] beats java.util.ArrayList for lookup. It beats java.util.ArrayList for datasets that are in the 2 billion range. That is incredibly fast. java.util.ArrayList is an array, right? And we're beating an array.