[Freeciv-Dev] Re: Profiling Civserver again
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Trent Piepho wrote:
> I see lots of places which iterate around the 8 neighbors of a tile,
> normalizing the coordinates each time. If the tile isn't on the boundary of
> the map, and most tiles aren't, then all those normalizations are unnecessary.
A very good point, if true.
Only two normalizations should be necessary for this iteration, not
eight:
* X X
X X
X X *
This way each individual X and Y coordinate is only normalized once.
This might make more sense in the code if the x and y normalizations are
split up; i.e.
normalize_map_x(int *x)
normalize_map_y(int *y)
These can be inlined or macro'd as desired. Nonetheless, doing it with
only two normalizations like this may require extra variables to be
added to the loop - a compromise might be more efficient.
jason
- [Freeciv-Dev] Profiling Civserver again, Paul Zastoupil, 2001/07/24
- [Freeciv-Dev] Re: Profiling Civserver again, Vasco Alexandre Da Silva Costa, 2001/07/24
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/07/24
- [Freeciv-Dev] Re: Profiling Civserver again, Trent Piepho, 2001/07/24
- [Freeciv-Dev] Re: Profiling Civserver again,
Jason Dorje Short <=
- [Freeciv-Dev] Re: Profiling Civserver again, Jason Dorje Short, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Reinier Post, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Thue, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Jason Dorje Short, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Trent Piepho, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Gregory Berkolaiko, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Jason Dorje Short, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Paul Zastoupil, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/07/25
- [Freeciv-Dev] Re: Profiling Civserver again, Ross W. Wetmore, 2001/07/25
|
|