On Fri, Aug 17, 2012 at 8:47 PM, Jim - FooBar(); <jimpil1...@gmail.com> wrote:
> As i was saying the design is pretty and elegant (and lazy!)...Unfortunately
> it is terribly slow! I mean unbelievably slow...4-5 min to reach level 4?
> How am I ever going to train by evolutionary means if searching takes so
> much time is beyond me! Ok let's see inside:
[...]
>
> As you can see all the usual suspects are there...letfn, pmap, max-key,
> closures etc etc. I thought it was rather clever using pmap when branching
> out from the root node but it turns out it only makes a tiny positive
> difference overall (20-30 sec)...also looking at mu cpus, not all of them
> are working even though there is so much work to be done on each branch
> (where futures were created). Is pmap just too good to be true? It is the
> first time i am using it seriously...
>
> Or am I looking at it completely the wrong way here? I mean, I have done
> this before in Java but it was only for checkers - not chess...we all know
> that chess has a staggering branching factor especially as soon as the game
> opens up a bit. Is it perhaps plain naive hoping to reach at least level 6
> in reasonable time (< 2min) functionally?

I have no particular insight regarding your code, and how to make
better. However, in general, I'd hazard a guess that high performance
game programs try to avoid memory allocations as much possible.
Preallocated arrays of sufficient sizes, etc, where values are filled
in and iterated over, stuff like that, rather than using functions
that yield temporary data structures that require memory allocation.

Perhaps check out http://www.tckerrigan.com/Chess/TSCP for a
non-optimized and written for clarity C Chess program that does not do
any memory allocation but uses fixed size arrays for the
search/principal variation, etc.

Lars Nilsson

-- 
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