Complete.Org: Mailing Lists: Archives: freeciv-dev: April 1999:
Re: [Freeciv-Dev] Some performance issues
Home

Re: [Freeciv-Dev] Some performance issues

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: mjd@xxxxxxxxxx
Cc: rizos@xxxxxxxxxxx, freeciv-dev@xxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Some performance issues
From: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Date: Sun, 18 Apr 1999 15:32:48 +1000

Mitch Davis wrote:
> Rizos Sakellariou wrote:

> >  As a solution,
> > i suggest to replace all occurrences of y*map.xsize with something like
> > an array ymult[y] whose elements (from 0 to map.ysize) are precomputed
> > at the beginning of each game.
> 
> Having a lookup table is a good idea.  We could either have a
> table with a well-known name, or a function to do a lookup.  On
> compilers such as gcc, the function could be made inline.
> 
> Hmm, the table sounds neater...

If we wanted to optimise for speed at the expense of some 
memory, we could make map.tiles a static 2-d array with the
maximum map sizes.  Presumably that would help optimisation.
(Probably talking around up to 100k memory waste, is my 
guestimate, depending on the actual map size.)

Or otherwise a table should be ok.  I think it should be 
possible to have this stuff all localised within common/map.c

Regards,
-- David

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