Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2001:
[Freeciv-Dev] Re: Profile.
Home

[Freeciv-Dev] Re: Profile.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: Profile.
From: Jason Dorje Short <vze2zq63@xxxxxxxxxxx>
Date: Sat, 13 Oct 2001 12:22:40 -0400
Reply-to: jdorje@xxxxxxxxxxxx

Gaute B Strokkenes wrote:

> I now have access to the department computers, so I can finally
> profile things without having to be nice to other interactive users
> and so on.  So I dug out my patch and profiled it thoroughly.

...

> So the absolute gain is 565.15 - 512.15 = 53 seconds, which is 9.4% of
> the total.  Not only have the 39.04 seconds billed to is_real_tile()
> vanished, but we have also gained 14 seconds in other functions.  If
> we look at the places which call is_real_tile(), such as
> map_get_city() which went from 18.17 to 16.27 seconds, it is not hard
> to see where those seconds came from: it is the function call overhead
> of is_real_tile() that has vanished.

Yesterday I did some tests and achieved a 15% increase in autogame speed
just by inlining normalize_map_pos.

I don't *really* want to get into an inline vs macro argument again, but
I think in the long run the solution is to make a new file, topology.h,
and make all topology functions static inline within that file.  This
will make everything fast while segregating the topology functions (all
of which need to be extended when you add a new topology) and keeping
everything pretty (having these functions be macros will be
exceptionally ugly when more than one topology is implemented).

As more and more code is converted to using the correct topology
functions, the overhead of these function calls will become larger.

jason


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