[Haskell-cafe] Re: Go Haskell!

Claus Reinke claus.reinke at talk21.com
Thu Nov 27 12:59:42 EST 2008


>>> http://computer-go.org/pipermail/computer-go/2008-October/016680.html
>> Interestingly, I did this a while ago.  Here's my results:
>> 
>> $ ./Bench 1 100000
>> b: 14840, w: 17143 mercy: 67982
>> elapsed time: 3.42s
>> playouts/sec: 29208
>> 
>> so, nearly 30k/sec random playouts on 9x9.  That's using a hack that stops 
>> the game when the score is heavily in favour of one player, it drops to 
>> around 20k/sec with that turned off.
> 
> Nice!-) 20k playouts/sec (without  the early cutoffs) is the rough number
> usually mentioned for these light playouts, reachable even in Java. My own
> Haskell code for that was a factor of 5 slower:-( 

actually, that 5x is relative to jrefbot on my machine (Pentium M760, 2Ghz),
which doesn't quite reach 20k/sec, so if your code would run at 20k/sec on
my laptop, it would be 10x as fast as my bot:-(( Since you can't release your
code, could you perhaps time the jrefbot from the url above on your machine 
as a reference point, so that I know how far I've yet to go? Something like:

    $ time ((echo "genmove b";echo "quit") | 
        d:/Java/jre6/bin/java -jar refbots/javabot/jrefgo.jar 20000)
    = E5

    real    0m2.539s
    user    0m0.030s
    sys     0m0.031s

Btw, I just realised where my bot dropped from 5x to 8x: to work around

    http://hackage.haskell.org/trac/ghc/ticket/2669

all my array accesses were wrapped in exception handlers, to get
useful error messages while I adapted my code to the refbot spec..

That's not the only bug that got in the way: 

    http://hackage.haskell.org/trac/ghc/ticket/2727

forced me to move from functional to imperative arrays much sooner 
than I wanted, and due to 

    http://hackage.haskell.org/trac/ghc/ticket/1216

I did not even consider 2d arrays (the tuple allocations might have gotten
in the way anyhow, but still..).

What do those folks working on parallel Haskell arrays think about the
sequential Haskell array baseline performance?

Claus

-- my slow bot's current time (for 20k playouts on a 2Ghz laptop):

    $ time ((echo "genmove b";echo "quit") | ./SimpleGo.exe 20000)
    TEXT e5 - amaf-score: 0.127
    TEXT e6 - amaf-score: 0.126
    TEXT d5 - amaf-score: 0.126
    TEXT f5 - amaf-score: 0.118
    TEXT d6 - amaf-score: 0.116
    TEXT f4 - amaf-score: 0.115
    TEXT e7 - amaf-score: 0.115
    TEXT f6 - amaf-score: 0.114
    TEXT d4 - amaf-score: 0.110
    TEXT d3 - amaf-score: 0.108
    TEXT e5 - amaf-score: 0.127
    = e5

    =

    real    0m10.711s
    user    0m0.030s
    sys     0m0.031s




More information about the Haskell-Cafe mailing list