gnugo-devel
[Top][All Lists]
Advanced

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

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


From: Arend Bayer
Subject: Re: [gnugo-devel] engine/influence.c (and DFA)
Date: Fri, 6 Sep 2002 08:14:09 +0200 (CEST)

On Thu, 5 Sep 2002, Evan Berggren Daniel wrote:

> Sounds like what we have is a memory allocation issue -- ie, most of the
> time spent in that function is really spent on allocating memory.
> Therefore, if we know at runtime how many owl_nodes we could possibly
> have, would it make sense to allocate that many initially and then keep
> track of them ourselves, instead of using malloc() and free()?  Just a
> thought, feel free to ignore it if the fact that I haven't looked at the
> code means I have no clue ;)

Well, there is neither malloc() nor free() in do_push_owl().

> > Instead, one could substantially reduce sizeof(local_owl_data) (and thus
> > both speedup do_push_owl and gain overall cache benefits) by
> > - maintaining eyes in a separate list, i.e. not keeping the eye
> >   information copied at every
> > - further compressing the eye data (e.g. the 3bit information of the
> >   eye color doesn't need a whole "int", etc.)
>
> Sounds good.  We might want to make things #define-able, because in some
> cases I think it is faster to move around and do math on full-size values.

Well, I dislike having too many #ifdefs. I would hope that it could be
a clear gain for all architectures, otherwise it's hardly worth doing.

Feel free to try s.th. out :-)


Arend






reply via email to

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