This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> (let [q (into (clojure.lang.PersistentQueue/EMPTY) (range 1000))] | |
(time | |
(loop [q3 q] | |
(let [e (peek q3)] | |
(if-not (nil? e) | |
(do | |
(recur (pop q3)) )))))) | |
"Elapsed time: 0.624344 msecs" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> (let [v (vec (range 1000))] | |
(time | |
(loop [v2 v] | |
(let [e (first v2)] | |
(if-not (nil? e) | |
(recur (subvec v2 1)) )))) ) | |
"Elapsed time: 0.864674 msecs" |
There was a fatal flaw in the implementation. It is now corrected. Thanks to the commentators.