Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2003:
[Freeciv-Dev] Re: Freeciv is too slow
Home

[Freeciv-Dev] Re: Freeciv is too slow

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: "Per I. Mathisen" <per@xxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Freeciv is too slow
From: "Per I. Mathisen" <per@xxxxxxxxxxx>
Date: Thu, 6 Nov 2003 18:33:02 +0000 (GMT)

On Thu, 6 Nov 2003, Per I. Mathisen wrote:
> On Thu, 6 Nov 2003, Paul Zastoupil wrote:
> > > If you could post a profile, then that would of course be a godsend.
>
> > http://www.freeciv.org/~paulz/reallyslow_gprof.out
>
> 33% of the CPU time goes into get_defender()

Most of the get_defender() calls come from, of course, fstk. We can avoid
a lot of those by checking if we need to call get_defender() first: We do
not need to if there is exactly one unit there. It is automatically the
returned punit anyway (unless errors are detected). We can also move the
'unit is on different continent, ignore it' check in the unit_list_iterate
a few lines up, so that it is checked before get_defender() is called.

Somehow I am not convinced this is the main problem here, though.

  - Per



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