[Freeciv-Dev] Re: Profiling Civserver again
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Perhaps someone could answer this for me: why do we _have_ to assume possible X
values outside [-map.xsize,2*map.xsize] ? When would this (legitimately) happen?
If a function is (naughtily) setting X too big or small, let's correct the
function. Grepping through the code, I don't see a massive number of places
where map_adjust_x() is called. Ought not be that hard to track down. Someone
please correct my naivete
-mike
On Thu, Aug 02, 2001 at 01:10:51AM +0200, Gaute B Strokkenes wrote:
> On Wed, 1 Aug 2001, vasc@xxxxxxxxxxxxxx wrote:
> > Well does gcc optimize it this way?
> >
> > #define map_adjust_x(X) \
> > (((X) % map.xsize) + (((X >= 0) - 1) & map.xsize))
>
> You mean * rather than &, right?
>
> > This is faster. Its faster on all CPUs. Notice it doesn't have any
> > branches. Of course its also pretty darn unreadable :-)
>
> I'm sceptical. Note that Gregory's patch, which replaced the modulus
> operations with two while loops, doubled the speed of
> normalize_map_pos(). It's too bad that there's no easy way to use
> loop constructs in macros, short of using inline functions instead.
> Perhaps the best thing would be to change it to trigger on
>
> (X) < 0 || (X) >= map.xsize)
>
> instead. Off course, the proof of the pudding is in the eating:
> Somebody really ought to profile all these different approaches,
> etc. etc.
>
> --
> Big Gaute http://www.srcf.ucam.org/~gs234/
> Are you mentally here at Pizza Hut??
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Lino Mastrodomenico, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Vasco Alexandre Da Silva Costa, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Gaute B Strokkenes, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Paul Zastoupil, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Trent Piepho, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again,
Mike Kaufman <=
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Mike Kaufman, 2001/08/01
- [Freeciv-Dev] Re: Profiling Civserver again, Raimar Falke, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/08/02
- [Freeciv-Dev] Re: Profiling Civserver again, Raimar Falke, 2001/08/06
- [Freeciv-Dev] Re: Profiling Civserver again, Thue, 2001/08/02
- [Freeciv-Dev] map_adjust_x (was: Profiling Civserver again), Mike Kaufman, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Jason Dorje Short, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Thue, 2001/08/02
- [Freeciv-Dev] Re: map_adjust_x (was: Profiling Civserver again), Ross W. Wetmore, 2001/08/02
|
|