You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the implementation of the _has search parameter in blaze.db.impl.search-param.has uses a cache for resource handles. The cache is filled by the computation function resource-handles* which can take a long time. One site has experienced a warning from Caffeine that the long-running computation halted eviction. So we should revisit why ne need that cache and if how we can handle the cache updates differently.
The text was updated successfully, but these errors were encountered:
This is a tiny cache at 100 entries, which means the number of internal hash bins is kept very low. These bins are locks in ConcurrentHashMap, so fewer leads to a higher chance of collisions between two independent writes. A simple solution is to increase the initialCapacity, which merely increases the table (array) size, to reduce the chance of colliding writes. For example setting it to 10_000 would not waste much space and make collisions much less common, but would not eliminate them.
A slightly more complex approach is to use AsyncCache, optionally with JCiP-style computations to avoid wasting threads. This performs the mapping updates immediately and defers the loading to be performed under the context of a future. An example in Java is below,
Currently the implementation of the
_has
search parameter inblaze.db.impl.search-param.has
uses a cache for resource handles. The cache is filled by the computation functionresource-handles*
which can take a long time. One site has experienced a warning from Caffeine that the long-running computation halted eviction. So we should revisit why ne need that cache and if how we can handle the cache updates differently.The text was updated successfully, but these errors were encountered: