I notice this code is using lists instead of vectors, this quite a
performance hit, on my machine:
(def my-vector (vec (range 0 1000)))
(def my-list (apply list (range 0 1000)))
;; ~30ms
(time (dotimes [x 100]
(nth my-vector 999)))
;; ~9000ms
(time (dotimes [x 100]
(nth my-list 999)))
On
On Apr 24, 10:52 am, tmountain wrote:
> Very cool. I actually cleaned up the code a little bit more this
> morning trying to speed things up a bit. It's still not as fast as I'd
> like, but I'm not up to speed on Closure optimization either, so I
> could be missing something.
I'm glad you are
tmountain a écrit :
> Very cool. I actually cleaned up the code a little bit more this
> morning trying to speed things up a bit. It's still not as fast as I'd
> like, but I'm not up to speed on Closure optimization either, so I
> could be missing something.
>
There are two things that I notic
On Fri, Apr 24, 2009 at 7:52 PM, tmountain wrote:
>
> Very cool. I actually cleaned up the code a little bit more this
> morning trying to speed things up a bit. It's still not as fast as I'd
> like, but I'm not up to speed on Closure optimization either, so I
> could be missing something.
This
Very cool. I actually cleaned up the code a little bit more this
morning trying to speed things up a bit. It's still not as fast as I'd
like, but I'm not up to speed on Closure optimization either, so I
could be missing something.
Revised code:
(ns markov
(use clojure.contrib.str-utils))
(def
Cool... I actually did a Markov chain generator myself as one of my
early Clojure projects. I posted about it at the DC Study group, here:
http://groups.google.com/group/clojure-study-dc/browse_thread/thread/26ccdc8acb102f9/d18d7627ddcaf167
It looks like yours is more succinct... I'll definitely