Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2001:
[Freeciv-Dev] Re: chance of winning a battle
Home

[Freeciv-Dev] Re: chance of winning a battle

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: chance of winning a battle
From: Gaute B Strokkenes <gs234@xxxxxxxxx>
Date: Sun, 22 Jul 2001 23:47:29 +0200

On Sat, 21 Jul 2001, Gregory.Berkolaiko@xxxxxxxxxxxxxx wrote:
> 
> ok I did some profiling (not too much, couple of turns, took 2
> cities or so, 6 AI players, server and client on the same machine)
> and here are some results:
> 
> the top of the pop is...
>      *applause*
> normalize_map_pos from common/map.c with 10.84% of the votes
>      *big applause*
> 
> the reason being it's called lots of times and is not optimal,
> attached is the patch that reduces the relative time to 4.54% and, I
> think, makes the function a bit safer.  we can do a bit better,
> substituting "if" for "while" on 2 occasions but it's unsafe (kind
> of assumes that we cannot go too far off the map).

Thanks, I've applied the patch.

-- 
Big Gaute                               http://www.srcf.ucam.org/~gs234/
Dizzy, are we "REAL PEOPLE" or "AMAZING ANIMALS"?


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