[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] engine/influence.c (and DFA)

From: Marco Scheurer
Subject: Re: [gnugo-devel] engine/influence.c (and DFA)
Date: Tue, 3 Sep 2002 20:11:54 +0200

On Tuesday, September 3, 2002, at 06:11  pm, Arend Bayer wrote:
On Tue, 3 Sep 2002, Marco Scheurer wrote:

Speaking of micro optimizations and speed/space trade offs, I've been
wondering about these:

- There are many bi-dimensional arrays. Would it make sense to replace
them by pointers to pointers? Two indirections are supposed to be faster than the arithmetic needed to access elements in a bi-directional array.
The syntax to read an element is the same, but some initialization code
is needed.

I think in all performance relevant spots (maybe with the exception of
influence.c), we are using one-dimensional arrays since the
1D-transition by Gunnar and Inge early in 3.1.x.

influence.c still has bidimensional arrays, I think, and even with the 1D transition you still have a multiplication, don't you? Based on what I read a (probably too long) while ago in Numerical Recipes in C, double indirection was faster than multiply, at least on Pentium.

Also, isn't chasing pointers supposed to be the worst possible you
can do the the cache? (I.e., most likely to result in cache misses.)

Yes, this could be an issue, and it probably depends, again, on architectures and compilers. This makes me think that all these optimizations (loop unrolling, inlining, etc) should probably be left out.

On the other hand, I've also been wondering what the PPC Altivec could do to the pattern matching code...

Marco Scheurer
Sen:te, Lausanne, Switzerland

reply via email to

[Prev in Thread] Current Thread [Next in Thread]