-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Milestone
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels