Complete.Org: Mailing Lists: Archives: freeciv-dev: December 1998:
Re: [Freeciv-Dev] slow goto
Home

Re: [Freeciv-Dev] slow goto

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Freeciv Development List <freeciv-dev@xxxxxxxxxxx>
Subject: Re: [Freeciv-Dev] slow goto
From: Massimo Campostrini <campo@xxxxxxxxxxxxxxxxxxxxx>
Date: 09 Dec 1998 09:02:57 +0100

"Andrew E. Schulman" <andrex@xxxxxxxxxxx> writes:

> In the later part of large games, I've noticed that movement under the
> "goto" command becomes veeerrrryyyy ssllllloooooowwwwww.  For example,
> sometimes a transport loaded with units will move as slow as 0.5 square/sec
> on my Sparc Ultra 1.  This especially slows down AI players, since they use
> goto a lot.  I expect that this happens because units are part of long
> lists that have to be traversed.  Does anyone know exactly the reason for
> this problem, and whether it can be improved?

Turning off "smooth move" in all clients helps a lot.

If it's still too slow, profile the code (both client and server)
before starting to optimize where it's not needed (I learned this from
hard experience :-( ).

If the culprit is indeed list traversing, we could move from lists to
AVL trees; a small RAM penalty, but a great speed win.  I'm using the
LGPL'd ubiqx library in my code (where I have several million
objects), and it works nicely.

        Massimo


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