[Freeciv-Dev] Re: freeciv profile data
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
On Sun, 19 Oct 2003, Jason Short wrote:
> > I made a few profiles of current freeciv.
...
> FYI, some of the biggest CPU consumers are:
>
> ai_manage_cities - 55% of execution time
> military_advisor_choose_build - 27%
> contemplate_new_city - 13%
> ai_manage_units - 25% of execution time
>
> these are simple to profile since they're all called in just one place.
> Together this is 80% of the server runtime.
Not surprising, really. However, this info is useful:
find_something_to_kill
auto_arrange_workers
both consume approx 20% of server's CPU time. Fewer calls to aaw should be
possible, and fstk should be canned.
Most critical subcomponent in fstk is invasion_funct() at 5.8% CPU time.
ai_choose_diplomat_offensive() at 4.8% should probably contain some more
cut-off breaks to avoid checking distant, worst-case targets.
Most positive surprise is ai_manage_buildings(), which only consumes 1.9%
CPU time. That is likely to change with gen effects. aidata and AI
diplomacy both consume only about 1%, nice. One of my biggest fears for
CPU waste was ai_best_government(), but it only consumes 0.2%... the
lesson from this is clear: Very expensive functions are no problem as long
as they are not called very often.
Also, generic_city_refresh takes 6% CPU time, and could probably easily be
improved by some inlining of its utility functions.
- Per
|
|