Surprising

unsorted — cgrand, 19 November 2008 @ 21 h 46 min
user=> (time (dotimes [i 100000000] [i]))
"Elapsed time: 5928.406543 msecs"
nil
user=> (time (dotimes [i 100000000] #(i)))
"Elapsed time: 1774.025749 msecs"
nil

So, it seems that creating a closure is faster than creating a vector. Cool.

0 Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

(c) 2024 Clojure and me | powered by WordPress with Barecity