I fixed my bottleneck-finding problem by applying the right jvisualvm
parameters.

You say:

>It's discouraged to use the mutable reference types in a fine-grained way
>like this. I would recommend changing your code to just be a vector of
>Clojure PersistentMaps that you map over.

What do you mean by this?
defstruct creates a struct-map which - as far as I know - is a
persistentmap.
And I do not use a vector because the amount of bodies that I map over
varies - for example when the player destroys a monster ;)

On Apr 23, 5:09 pm, David Nolen <dnolen.li...@gmail.com> wrote:
> In your code you have:
>
> (defstruct body
>   :id
>   :type ; :projectile or :unit -> projectiles do not collide with other
> bodies;
>   :current-position ; ref
>   :current-cells  ; ref
>   :current-rotation  ;atom
>   :pixel-half-width :pixel-half-height
>   :half-width :half-height
>   :components) ; a map of (:comp-type comp)
>
> It's discouraged to use the mutable reference types in a fine-grained way
> like this. I would recommend changing your code to just be a vector of
> Clojure PersistentMaps that you map over.  It seems that your program is not
> so dissimilar from something that I worked on, you might want to look at
> this code for some ideas how to improve the speed of your 
> code:http://github.com/swannodette/flocking/blob/master/src/flocking/flock...
>
> When I first implemented this in early 2008 it was taking about 100-120ms to
> update 150 "boids". This version can do it in about 6-8ms.
>
> I also note that you're not type-hinting your math, but I'm unsure how much
> that plays into the perf you're seeing.
>
> David
>
> On Fri, Apr 23, 2010 at 4:55 AM, msappler <damnedmar...@web.de> wrote:
> >http://pastebin.com/Vv7xr6Uj
>
> --
> 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
> Note that posts from new members are moderated - please be patient with your 
> first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group 
> athttp://groups.google.com/group/clojure?hl=en

-- 
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
Note that posts from new members are moderated - please be patient with your 
first post.
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