Re: (into [] (take n v)) vs (subvec v 0 n)

2013-02-01 Thread Marko Topolnik
Also make sure to keep in mind that subvecs are *second class* objects and are not equivalent to regular vectors in terms of API. See for example this issue. > I wouldn't worry too much about subvectors. Unless you identify them as a > bottleneck

AW: (into [] (take n v)) vs (subvec v 0 n)

2013-01-31 Thread Meikel Brandmeyer
unden -Ursprüngliche Nachricht- Von: Don Jackson An: "clojure@googlegroups.com" Gesendet: Fr, 01 Feb 2013, 01:23:36 MEZ Betreff: (into [] (take n v)) vs (subvec v 0 n) In the app I am working on, I have a number of pre-computed,cached collections, and for each collection, I have an ac

(into [] (take n v)) vs (subvec v 0 n)

2013-01-31 Thread Don Jackson
In the app I am working on, I have a number of pre-computed,cached collections, and for each collection, I have an accessor function that returns either the entire collection or the first n elements. Currently the underlying collection is a vector, so I had something like this: (defn foo-acc