[Freeciv-Dev] Re: (PR#7278) Profile of current cvs server
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=7278 >
On Wed, Jan 21, 2004 at 10:26:20AM -0800, Arnstein Lindgard wrote:
>
> <URL: http://rt.freeciv.org/Ticket/Display.html?id=7278 >
>
> On Wed, 21 Jan 2004 08:37:57 -0800 Per I. Mathisen wrote:
>
> > Don't look to hard on this table. As the rest of the profile no doubt will
> > show you, it is certain AI functions which consumes CPU power in the
> > server. A very large number of very small improvements is much less useful
> > than a few well-placed optimizations of key algorithms.
>
> No doubt you are right. I can believe the best way of optimizing is
> something like what Ross just described in general terms, caching
> tilepointers etc.
It is about macro vs micro optimizations. Both macros and inlineing
are micro optimizations. However if you exchange a quadratic algorithm
with a linear one this is a macro optimization. Some goes one for
reducing the numbers by a near constant amount: instead of going over
all units of all players you only go over the units of one
player. This will give a reduction in the range of 1 to 20. But these
case are unlikely to find in the current code anymore. What you can
IMHO however find are multiple call to create warmaps/pf_maps for the
same unit during turn-end. I guess that you can gain 10-30% if you
remove a second creation of a warmap/pf_map for all military AI units
at turn-end.
Raimar
--
email: rf13@xxxxxxxxxxxxxxxxx
"The Internet is really just a series of bottlenecks
joined by high speed networks."
-- Sam Wilson
|
|