[CCACHE-15] It appears that TTL cache exhibits quadratic performance (+ its evict is buggy) Created: 14/Dec/11 Updated: 15/Dec/11
The library looks useful, thanks!
I looked at the code, and unless I'm mistaken, every cache miss seems to result in a full pass over the entire cache to evict old entries. The performance implications of this would be unacceptable for my target application. Replacing the TTL data structure with a persistent analog of a LinkedHashMap and using a take-while instead could fix this problem.
Also, evict seems to pass the cache in twice, rather than the cache and the TTL...
|Comment by Fogus [ 15/Dec/11 12:21 PM ]|
TTLCache eviction fixed. Patches welcomed for the other change, but we might be able to get away with a sorted map ttl map.