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
We currently rely on ConcurrentMap's default implementations of compute(), computeIfPresent() and merge() methods.
This has two downsides:
we end up traversing the TrieMap multiple times (get() + putIfAbsent()/replace()/remove() invocations)
the computation function may be invoked multiple times if face of races
Implement these methods for MutableTrieMap, so the traversal is minimized and we call the mapping function as little as possible.
This is a mixed bag a bit, but mostly revolves around INode operations. computeIfPresent() is essentially a replace(), except the value to store is computed when we have found a matching node. compute() combines that with an insert operation (in case of non-presence, which something #147 deals with). merge() combines all these together, based on lookup result and mapping function result.
The text was updated successfully, but these errors were encountered:
We currently rely on ConcurrentMap's default implementations of compute(), computeIfPresent() and merge() methods.
This has two downsides:
Implement these methods for MutableTrieMap, so the traversal is minimized and we call the mapping function as little as possible.
This is a mixed bag a bit, but mostly revolves around INode operations. computeIfPresent() is essentially a replace(), except the value to store is computed when we have found a matching node. compute() combines that with an insert operation (in case of non-presence, which something #147 deals with). merge() combines all these together, based on lookup result and mapping function result.
The text was updated successfully, but these errors were encountered: