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

[Freeciv-Dev] Re: Profiling Freeciv.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Thue <thue@xxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Profiling Freeciv.
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: 05 Jan 2001 09:24:00 +0100

On Thu, 4 Jan 2001, thue@xxxxxxx wrote:

> -Looking a bit further I found that removing the ai_manage_explorer on 
> aiunit.c:1549 cuts execution time by 25%.

Yes.  It does a whole_map_iterate() among other things.  About three
quarters of the speedup with my (experimental) changes come from that
function alone (counting children, of course).

> I am not sure that we want to remove it though.

Probably not.  I think I can come up with a faster version if you give
me some time, though.  I'll also look at invasion_funct() and its
parent, find_something_to_kill() .  Both look like stuff that no one
has dared to touch in a while (fstk has variables a, b, c, d, e, m, n,
v, i, f, a0, b0, ab, g).

> -On my system I note that really_generate_warmap takes 2.36ms/call versus 
> 379ms/call in 1.10 :)

Wow.  I'm glad I haven't tried running 1.10 on my 486...

> -city_refresh() takes a neglegtable amount of time. We skipped some calls to 
> thins function because of CPU concerns, that will be revised...

> Converting small functions into macros is ok, but generelly
> optimizations don't have to be very ugly before I don't think it is
> justified for performance IMO.

I agree.  I'm not that enthusiastic about converting functions into
macros, really, since there are some tricky issues involving arguments
with side effects.  (GCC produces warnings in such cases and also
offers a (non-portable) way to get around this.  It's still ugly.)

An alternative is to use inline functions which are much more portable
and have a clean fall-back if they're not available.  However, the `an
inline function is as fast as a macro' maxim isn't always entirely
true, notably under GCC.

> Most people have a better processor than a 4x68.  (and those people
> who do have a 4x86 shouldn't play 15 AI games on 160x90 maps). On
> your system an AI turn took15 minutes, on my celeron 400 it took 1
> minute. And people will continue to get faster systems.

I think that a 6 second improvement on 60 seconds is still very
worthwhile.  Also, while I'm at university I use a machine that is a
lot faster.  End of turn updates take a lot less time, but are still
slow enough to be annoying.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Now I'm being INVOLUNTARILY shuffled closer to the CLAM DIP
 with the BROKEN PLASTIC FORKS in it!!



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