[freeciv-ai] Re: (PR#6912) Optimize/reimplement CM: per-city caches
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
undisclosed-recipients: ; |
Subject: |
[freeciv-ai] Re: (PR#6912) Optimize/reimplement CM: per-city caches |
From: |
"Benoit Hudson" <bh@xxxxxxxxxxxxxxxxxxx> |
Date: |
Sun, 30 Nov 2003 15:25:09 -0800 |
Reply-to: |
rt@xxxxxxxxxxx |
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6912 >
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.
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.
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.
-- Benoît
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freeciv-ai] Re: (PR#6912) Optimize/reimplement CM: per-city caches,
Benoit Hudson <=
|
|