hawkw / sharded-slab

a lock-free concurrent slab (experimental)
MIT License
269 stars 17 forks source link

perf: consolidate per-slot state into one AtomicUsize #6

Closed hawkw closed 4 years ago

hawkw commented 4 years ago

This change moves all the per-slot shared state (generation, ref count, and removal state) into a single AtomicUsize. This has several advantages:

There isn't really any noticeable performance impact before/after. The "after" benchmarks are generally about ~2-5% faster across the board, but I'm not sure if this is really significant (even though Criterion claims it is).