So I tried with and without r/fold and I do get an almost 3x speedup for
level 2 (a depth i can easily test)...
I get 60,598 ms without r/fold VS 23,901 ms with r/fold...so this is
good - at least it's showing improvement (more than 2x)!
However, level 4 (which is the crucial level i want to train at) is ages
away! I'm really not that patient to test it, but it seems it's well
over 5 min away...How is that possible? An imperative for-loop in Java
needed less than 2min to reach level 4, 3 years ago! Now I'm using all 4
cores at 99% and nothing is happening...it is just heating up (my ubuntu
becomes less responsive as well)!
Jim
ps: Could it be that the sequential version really is a lot worse than
what I'm approximating?
On 22/08/12 14:20, Jim - FooBar(); wrote:
On 22/08/12 14:08, nicolas.o...@gmail.com wrote:
You should see a close to *4 speed up, at least in the level 4.
One thing that could happen is if some of your functions are using
an atom or a reference and the threads keeps bumping into each other
and retrying.
Are you sure that both next-level and core-by-count are pure functions?
(And any other that are used in the search....)
Well, the next-level fn derefs a promise (which holds a map with the
current game's details) to produce the next boards but never changes
it so has no side-effects...score-by-count is also pure - it just
returns a number!
The problem is that (:value Integer/MIN_VALUE) is nil, which looks
like a bug and make your code hard to understand.
I'm really sorry but I don't follow...I'm only doing (:value best) or
(:value next). best or next return a Move-Value (it has :move and
:value keys) where the :value key could be Integer/MIN_VALUE - I'm not
doing (:value Integer/MIN_VALUE) anywhere...
Jim
--
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