[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]
<URL: http://rt.freeciv.org/Ticket/Display.html?id=6912 >
> [bhudson - Thu Nov 20 16:41:42 2003]:
>
> This patch stores the cache on a per-city basis. Once we do that, we
> can think about caching better between calls, which will make things
> faster (this patch doesn't make a huge difference right now: I can run
a
> server-only game in 3:50 rather than 3:58, which is likely just noise)
.
> The memory usage is quite reasonable, and I've tested for leaks and
> found none in this code (hence all the recent leak patches in other
code).
>
> A reason why this isn't much faster is that cache1/cache2 (which
compute
> the true results for an allocation of workers and specialists) are
hard
> to cache across calls and expensive, while cache3 (store an allocation
> of workers and the unmodified results) is easy to cache but cheap to
> compute. So we'll need to get smarter about not clearing
cache1/cache2
> every time.
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
Raimar
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freeciv-ai] (PR#6912) Optimize/reimplement CM: per-city caches,
Raimar Falke <=
|
|