[Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesia
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
<URL: http://RT::WebBaseURL.not.configured:80/Ticket/Display.html?id=10047 >
Here is a new version of the patch. I fixed a bug in my changes to
iterate_axe. Autogames are now identical.
When running in DEBUG, this makes the server run 5-15% faster. When
running NDEBUG, this drops to 0-5% faster. These numbers are slightly
better for isometric maps.
There is a cost of 80k of memory for the extra 20 bytes per tile to
store (index,map_x,map_y,nat_x,nat_y) values for each tile. Of course
we don't really *have* to store any of these. The index can be
determined by the pointer value and the others can be found from the
index. It is a tradeoff of speed and convenience versus memory.
However speed isn't the real advantage of the new system. The advantage
is the code is shorter and simpler and safer. It becomes obvious where
normalizations and CHECK_MAP_POS checks are needed. It is possible to
have a "no-tile" special-case without resorting to hackery. And the
whole thing is typesafe so there's no chance of confusing your x's and
y's with your i's and j's.
I'm still not sure what to do with it, though.
jason
- [Freeciv-Dev] Re: (PR#10047) RFC: restructuring map code to not use cartesian coordinates, Per I. Mathisen, 2004/09/25
- [Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesian coordinates,
Jason Short via RT <=
- [Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesian coordinates, Jason Short via RT, 2004/09/27
- [Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesian coordinates, Jason Short via RT, 2004/09/28
- [Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesian coordinates, Marcelo Burda, 2004/09/28
- [Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesian coordinates, Jason Short via RT, 2004/09/28
- [Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesian coordinates, Jason Short via RT, 2004/09/28
- [Freeciv-Dev] (PR#10047) RFC: restructuring map code to not use cartesian coordinates, Jason Short via RT, 2004/09/28
|
|