Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2000:
[Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player b
Home

[Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player b

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Thue Janus Kristensen <thue@xxxxxxx>
Cc: Jules Bean <jmlb2@xxxxxxxxxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug)
From: Tony Stuckey <stuckey@xxxxxxxxxxxxxxxxx>
Date: Wed, 17 May 2000 15:14:45 -0500

On Wed, May 17, 2000 at 04:02:42PM +0200, Thue Janus Kristensen wrote:
> On Wed, 17 May 2000, Jules Bean wrote:
> > This is probably a great idea for clean code, but I'd just like to
> > point out that the CPU argument is bogus ;-) The time to dereference a
> > pointer is a single cycle, (assuming it's in a cache) and that's just
> > not going to stack up compared to the path-finding code which we all
> > suspect is the current bottleneck.

        In my profiles, map_get_tile(), really_generate_warmap(),
map_get_terrain(), map_get_continent(), and find_genlist_position()
typically account for 15-20% of the total program run time.
        Since 4 of these functions are "one liners", it's pretty clear that
weaker higher-level algorithms are examining way too much data.

> Btw; maybe these oneline functions like map_get_know() should be made into
> macros to avoid the overhead of a function call; is the saving worth it?
> Is there any reason not to?

        I've experimented with this in the past.  I don't recall the
results.  I think I was mostly working with is_ground_unit() and friends,
though.

        It's definitely an idea to try more thoroughly.
-- 
Anthony J. Stuckey                              stuckey@xxxxxxxxxxxxxxxxx
"And they said work hard, and die suddenly, because it's fun."
        -Robyn Hitchcock.



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