[Top][All Lists]

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

Re: [gnugo-devel] paul_3_13.6

From: pogonyshev
Subject: Re: [gnugo-devel] paul_3_13.6
Date: Mon, 9 Dec 2002 10:47:54 +0100 (MET)

i wrote:
> - the order of indices in transformation[][] and spiral[][]
>   arays swapped. improves caching.

actually, it not only improves caching, but also replaces MAX_ORDER /
MAX_OFFSET multiplier by 8. this of course produces faster machine instruction.
there's another nice thing which became available when the indices had been
swapped. we can pre-multiply all offsets in databases by 8 (this only applies to
transformation[] array of course) and remove multiplications from the matcher
itself. this in fact, will make the array one-dimensional (much like the
board[] array now). so, we'll have it declared like

  int trasformation[8 * MAX_OFFSET];

and we'll convert offsets like

  position = anchor + transformation[position_offset + ll];

we can even pass not `ll', but `transformation + ll' to a function, so it
will simply use

  position = anchor + trans[position_offset];

unfortunately, reducing the size of transformation[][] array is not possible
without significant changes to pattern maker. this is mainly because of
fuseki and handicap pattern databases. however, if we come up with a nice way to
reorganize the array (place "small" offsets - near (0,0) - in the beginning)
this won't matter much, because "large" offsets are rarely used and don't
infuent caching much. besides, after the indices have been swapped, all the
"small" offsets group in the very beginning of the array, not in 8 distinct 
of it.


+++ GMX - Mail, Messaging & more +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!

reply via email to

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