Open mmonetha-sobis opened 1 year ago
Currently it will be more efficient to do this via external iteration and calls to remove(K)
as this will avoid unnecessary deserializations. I just created a draft PR that makes this true for removeAll(...)
as well (#3138) but it needs some close review/checking before it can be merged.
Having an iteration like
for (Cache.Entry<ICustomCacheKey, Serializable> entry : cache) {
if (entry != null) {
ICustomCacheKey cachedKey = entry.getKey();
LOGGER.trace("Iterating over {} on {}", cachedKey, cacheName);
if (cachedKey.matches(givenKey)) {
cache.remove(cachedKey);
LOGGER.debug("'{}' was removed from cache '{}'.", givenKey, cacheName);
}
}
}
also deserializes values. Can you provide more details about the external iteration you had in mind?
Hi Chris, is there some update on this topic?
Thanks in advance!
Hi Chris, we are again stumbling across this issue, are there any news regarding our original question?
Hi, at my company, we've encountered some issues connected to our cache invalidation logic.
For each cache entry that should be invalidated
We refactor our implementation that
Unfortunately the performance appears to be unchanged.
We then started checking the ehcache code base and realized that both operations (remove and removeAll) also deserialize the cache entry's value everytime either operation is called.