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 1000000]
(nth my-vector 999)))

;; ~9000ms
(time (dotimes [x 1000000]
(nth my-list 999)))

On Wed, May 13, 2009 at 12:59 PM, Jeremy James <jja...@gmail.com> wrote:

>
>
>
> On Apr 24, 10:52 am, tmountain <tinymount...@gmail.com> 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 asking about this.  I wrote the python that inspired
> this and have been learning clojure to help diagnose the reasons for
> slowdown.  I was hoping to get my head around it enough to apply some
> of the ideas mentioned in this article (from a thread on this group a
> few days ago):
>
> http://gnuvince.wordpress.com/2009/05/11/clojure-performance-tips/
>
> I developed this for practical (well, semi-practical) purposes and
> would be keen on porting the larger codebase to clojure if Travis can
> get this running faster than the python implementation.
>
> -Jeremy
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to 
clojure+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to