>
> Have you considered using clojure.lang.PersistentQueue instead of
> vector and subvec?
Indeed, I am using that, thanks. (I happened to stumble across an
earlier newsgroup post on this subject). Maybe all of the useful conj/
subvec usage patterns for vectors can be served by PersistentQue
On Sun, Jan 4, 2009 at 2:55 PM, Jason Wolfe wrote:
>
> Now that I think about it some more, though, this change doesn't
> really address the whole problem.
>
> ; Time to queue up and dequeue a bunch of elements
> user> (doseq [n '(10 100 1000 1 10)]
>(do (prn n)
>(time
Nope, I have not sent in a CA yet. I'll do it sometime this week.
Now that I think about it some more, though, this change doesn't
really address the whole problem.
; Time to queue up and dequeue a bunch of elements
user> (doseq [n '(10 100 1000 1 10)]
(do (prn n)
(t
On Sat, Jan 3, 2009 at 5:50 AM, Jason wrote:
>
> As you can see here, accessing elements of nested subvectors is slow.
>
> user> (doseq [i (map #(Math/pow 2 %) (range 0 16))]
>(print i " ")
>(let [sub (nth (iterate #(subvec % 0 1) [1]) i)]
> (time (dotimes [_ 1] (sub
As you can see here, accessing elements of nested subvectors is slow.
user> (doseq [i (map #(Math/pow 2 %) (range 0 16))]
(print i " ")
(let [sub (nth (iterate #(subvec % 0 1) [1]) i)]
(time (dotimes [_ 1] (sub 0)
1.0 "Elapsed time: 1.929 msecs"
...
128.0 "Elap