count me is extreeeemly slow under contention. This is expected, becaues the current imple is roughly loop { be_slow() }.
We should make it faster.
I see two approaches:
Use therad-local hash maps, which are registered with a global map on thread creation (Arc/Weak). I think this is possible with the current API. Must not regress single thread perf though!
Back each variable by atomic relaxed counter. This I think would need an FastCount type and fast_count! macro.
count me is extreeeemly slow under contention. This is expected, becaues the current imple is roughly
loop { be_slow() }
.We should make it faster.
I see two approaches:
Use therad-local hash maps, which are registered with a global map on thread creation (
Arc/Weak
). I think this is possible with the current API. Must not regress single thread perf though!Back each variable by atomic relaxed counter. This I think would need an
FastCount
type andfast_count!
macro.See also https://arxiv.org/abs/1701.00854