Complete.Org: Mailing Lists: Archives: freeciv-dev: June 2002:
[Freeciv-Dev] Re: [RFC] Path finding implementation.
Home

[Freeciv-Dev] Re: [RFC] Path finding implementation.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Raimar Falke <rf13@xxxxxxxxxxxxxxxxx>
Cc: Gregory Berkolaiko <Gregory.Berkolaiko@xxxxxxxxxxxx>, "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>, Freeciv Development List <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: [RFC] Path finding implementation.
From: "Ross W. Wetmore" <rwetmore@xxxxxxxxxxxx>
Date: Sun, 30 Jun 2002 06:28:26 -0400

At 09:09 PM 02/06/29 +0200, Raimar Falke wrote:
>On Sat, Jun 29, 2002 at 07:31:04PM +0100, Gregory Berkolaiko wrote:
>> Mmm...

[...]
>> Thus if we had an iterator working directy with xy, 
>>      adjc_xy_iterate(xy, xy1) {
>>        /* ... */
>>      }
>> this would make indexed approach both the most convinient and the fastest.
>
>I don't think that you can improve the access much beyond two memory
>accesses and one lea (which you get with 2D array).

Not with your precomputed reference flavour, you are correct in this.

But in most cases, you will drop your index array access and end up with 
a single memory access when accessing the value if you don't try to out 
think the compiler and just let it handle the index computations :-).

>       Raimar
>-- 

Cheers,
RossW
=====




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