[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: computer-go: Sharing Go modules
On Wed, May 16, 2001 at 10:47:30PM -0700, Man Lung Li wrote:
> A one dimensional array doesn't avoid the multiply. You are doing the
> multiply yourself to convert x,y to index. I think modern day optimized
> compiler is more efficient than calculating the address yourself.
Right, if you have to go from x,y. But in most routines you just pass the
already-multiplied number, and operate on it directly. This saves you not
only a multiplication, but also the trouble of passing two parameters
instead of one. Small things, but you do them so many times, that they may
well make a difference.
--
Heikki Levanto LSD - Levanto Software Development <heikki@xxxxxxxxxxxxxxxxx>