Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2003:
[Freeciv-Dev] Re: (PR#6182) remove some static map-sized arrays
Home

[Freeciv-Dev] Re: (PR#6182) remove some static map-sized arrays

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: jdorje@xxxxxxxxxxxxxxxxxxxxx
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6182) remove some static map-sized arrays
From: Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Wed, 22 Oct 2003 09:36:51 +0200

On Thu, Sep 18, 2003 at 09:15:10AM -0400, Jason Short wrote:
> Gregory Berkolaiko wrote:
> >On Thu, 18 Sep 2003, Bursig Rafal wrote:
> >
> >
> >>Sorry this msg was rejected by RT then I sent it to list
> >
> >
> >I remember there was a big discussion on this with Ross and Raimar very 
> >active participants.  IIRC there was no verdict as there were argument 
> >both for and against using array[x][y] vs array[x * size + y]
> 
> I prefer the array[x][y] form.  Except that it breaks under 
> gen-topologies and consumes more memory.

The difference is a multiplication with a non-constant vs a memory
access. Which one is faster depends heavily on your architecture. The
determining thing is what Jason mentions above: gen-topologies needs
the 1D array.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  reality.sys corrupt. Reboot Universe? (y,n,q)


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