Complete.Org: Mailing Lists: Archives: freeciv-dev: July 2001:
[Freeciv-Dev] Re: Profiling Civserver again
Home

[Freeciv-Dev] Re: Profiling Civserver again

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Profiling Civserver again
From: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxxxx>
Date: Wed, 1 Aug 2001 05:21:30 +0300 (IDT)

Jason is right when he says that cleaning up map_adjust_x should do good.
I think a good portion of CPU time spent in get_map_tile is wasted on two
modulus ( % ) operations in map_adjust_x.  One is completely unnecessary,
as was mentioned earlier.  Is it possible to get rid of the second one(s)
in a safe way without converting the macro to a function?

Err, and a stupid question, how does int -> unsigned int conversion work?
Is the behaviour standard?

G.

On Tue, 31 Jul 2001, Ross W. Wetmore wrote:

> Personally I prefer doing something like the following in map.h ...
> 
> #ifndef MAP_GET_TILE_FUNCTION
> 
> /* WARNING: these are macros - do not use arguments with side effects */
> #define map_get_tile(x,y)     ( \
>   ((unsigned)(y) >= (unsigned)map.ysize)  \
>   ? &void_tile               \
>   : map_get_tile_unchecked(map_adjust_x(x),(y)))



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