[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]
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.
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), (continued)
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Jules Bean, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Mika Korhonen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Thue Janus Kristensen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Mika Korhonen, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Robert Brady, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Daniel Burrows, 2000/05/17
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug), Jed Davis, 2000/05/19
- [Freeciv-Dev] Re: somebody fix struct *player! (was: FoW remove player bug),
Tony Stuckey <=
[Freeciv-Dev] Re: FoW remove player bug, Daniel Burrows, 2000/05/16
|
|