Hi, The initial release of core.rrb-vector, a Clojure Contrib library enabling logarithmic-time concatenation and slicing of Clojure vectors, should be available from Maven Central within 24 hours.
The functionality provided is enabled by RRB-Trees, a vector-like data structure capable of sharing structure with regular vectors introduced in Bagwell & Rompf, "RRB-Trees: Efficient Immutable Vectors", EPFL-REPORT-169879, September, 2011. core.rrb-vector started its life as flexvec and was recently accepted into Clojure Contrib. The official project repository is available here: https://github.com/clojure/core.rrb-vector To take it for a spin in a Leiningen project, add [org.clojure/core.rrb-vector "0.0.9"] to your :dependencies; then at the REPL say (require '[clojure.core.rrb-vector :as fv]) (doc fv/catvec) (doc fv/subvec) This should probably be considered alpha-stage software, if only because there is one piece of the Clojure vector API not yet supported (transients). What is implemented (everything else in the standard vector API plus the two new operations) should work, however; if there are any issues, reports thereof would be highly appreciated. Note that due to certain complications around sharing structure with Clojure's PersistentVector, core.rrb-vector only supports Clojure >= 1.5.0. The functions provided by core.rrb-vector can take all regular Clojure vector types as arguments (this includes vectors of primitives produced by clojure.core/vector-of) and return RRB vectors which support the full Clojure vector API with the exception of transient operations (support for which will be introduced in a future version). Of course RRB vectors themselves can then be further concatenated and sliced. NB. the element types of vectors to be concatenated together must match. (In particular, RRB vectors produced as a result of concatenating or slicing vectors of primitives will themselves store unboxed primitives.) With the current implementation of catvec, concatenating two regular PersistentVector instances of 2048 elements each is faster with catvec than with into at my REPL; at 1024 elements into is faster. A future version will replace the current implementation of catvec with a lower-level one, so the threshold will shift; at some point, the straightforward optimization of delegating to into below some experimentally determined size of the right argument will be introduced. (In fact, vectors of up to 32 elements are already handled in this way because of certain implementation details.) See the README or (doc clojure.core.rrb-vector) for more information. Cheers, Michał -- -- 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 --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.