[Freeciv-Dev] (PR#11562) Freeciv Server Performance
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://bugs.freeciv.org/Ticket/Display.html?id=11562 >
> [jdorje - Fri Dec 17 21:55:39 2004]:
> Right now I'm looking most closely at the auto_arrange_workers call in
> update_city_tile_status(). This is called any time an enemy unit makes
> a worked tile unavailable. This call seems to account for 2/3 of the
> aaw calls and 20% of the overall server runtime. This call is
> fundamentally unnecessary, but fixing it isn't that easy. However a
> simple greedy algorithm to move a SINGLE worker would be the best way to
> fix it (currently we place all workers from scratch).
How about: update_city_tile_status just moves the worker into an elvis.
The client can run the CM immediately upon getting the update
about the new tile status, if it so desires. Never call the CM for the
client, except when the player acquires a new city.
For AI players, put the city on a list of cities on which to call
auto_arrange_workers at the end of the turn.
With this, we get optimal arrangement for the AI without
recomputing it all turn long; similarly we get it for the client
without overloading the server.