Complete.Org: Mailing Lists: Archives: freeciv-ai: February 2004:
[freeciv-ai] (PR#6912) Optimize/reimplement CM: per-city caches
Home

[freeciv-ai] (PR#6912) Optimize/reimplement CM: per-city caches

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: bh@xxxxxxxxxxxxxxxxxxx
Subject: [freeciv-ai] (PR#6912) Optimize/reimplement CM: per-city caches
From: "Jason Short" <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 26 Feb 2004 17:14:22 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=6912 >

> [bhudson - Sun Nov 30 23:25:08 2003]:
> 
> On Thu, Nov 27, 2003 at 06:04:18AM -0800, Raimar Falke wrote:
> > 
> > The patch is here 15% faster. I have however problems with the patch:
> >  - the indexing via city id is bad
> >  - storing the parameter in the cache struct is bad
> 
> Hmm.  More profiling on my side shows about the same thing.
> BTW, I'm aware that the patch suffers from bit rot already; I can
> provide a new patch sometime after Friday.

And?

> Indexing via city id: what's the problem with that?  I guess if indexing
> is the problem, then I could just use a hash table.

I dunno.  AFAIK city id's are universally unique.

> Storing the parameter: what's wrong with that?  The idea of storing it
> is for two reasons: (1) it's handy (fewer arguments to all the
> functions, which BTW also should give a miniscule speedup); (2) in the
> hypothetical future, if we can prove all is identical to before, then we
> can just return the old answer; for that, we need to store a copy of the
> parameter.  But whatever; I don't feel strongly about it, and the
> hypothetical future can be dealt with when it hypothetically arrives.

Is it possible data is being overwritten, so data from one city is being
used for another?

jason



[Prev in Thread] Current Thread [Next in Thread]
  • [freeciv-ai] (PR#6912) Optimize/reimplement CM: per-city caches, Jason Short <=