[computer-go] Fast inner loops in Go

David Fotland fotland at smart-games.com
Fri Sep 1 18:55:56 PDT 2006


These lists are very short, so the loop is small.  I find that I often
iterate over the neighbors, and I think iterating a list is faster than
iterating a bitset.  I don't there is really much difference.  Better to
focus on better knowledge or learning, than making inner loops a little bit
faster.

David

> -----Original Message-----
> From: computer-go-bounces at computer-go.org 
> [mailto:computer-go-bounces at computer-go.org] On Behalf Of 
> Anders Kierulf
> Sent: Friday, September 01, 2006 2:26 PM
> To: 'computer-go'
> Subject: RE: [computer-go] Fast inner loops in Go
> 
> 
> > Many Faces does something similar.  I keep linked lists of neighbor 
> > points by color (black, white, and empty), so if I want to find the 
> > black neighbors, I just walk one list, with no test in the loop.
> > 
> > David
> 
> Linked lists of neighbors of each color make the inner loops 
> fast, but I suspect you're paying a higher price when adding 
> or removing stones, as removing a point from a linked list 
> usually involves a loop. You'll also have to update two lists 
> each time. Using a bitset to denote the neighbors avoids that 
> loop, and does both the adding and removing in one operation.
> 
> Anders Kierulf
> www.smartgo.com
> 
> _______________________________________________
> computer-go mailing list
> computer-go at computer-go.org 
> http://www.computer-go.org/mailman/listinfo/computer-go/
> 



More information about the computer-go mailing list