#index #access #arena #slot #data #structures #exclusive

arena64

A concurrent arena providing mutually exclusive access over indexes

4 releases

new 0.4.2 Jan 23, 2025
0.4.1 Jan 21, 2025
0.4.0 Dec 27, 2024
0.3.1 Dec 23, 2024
0.1.4 May 12, 2024

#1031 in Data structures

Download history 1/week @ 2024-10-13 2/week @ 2024-11-03 2/week @ 2024-11-17 135/week @ 2024-12-01 5/week @ 2024-12-08 374/week @ 2024-12-22 14/week @ 2024-12-29 1/week @ 2025-01-05 176/week @ 2025-01-19

225 downloads per month

MIT license

25KB
592 lines

Arena64

License Cargo Documentation

Arena64 provides data structures that pre-allocate storage for 64 elements at a time with insertions yielding slots that uniquely own access to the respective cell. Comparable to Box, slots can be converted into/from raw pointers by storing the index in the low-bits, making them well-suited for use cases requiring thin-pointers.

Benchmark Results

Alloc

Box Bump64 Arena64
64 967.87 ns (✅ 1.00x) 234.03 ns (🚀 4.14x faster) 333.00 ns (🚀 2.91x faster)
128 1.92 us (✅ 1.00x) 444.37 ns (🚀 4.32x faster) 646.06 ns (🚀 2.97x faster)
256 3.81 us (✅ 1.00x) 848.89 ns (🚀 4.49x faster) 1.30 us (🚀 2.94x faster)
512 7.69 us (✅ 1.00x) 1.64 us (🚀 4.69x faster) 2.57 us (🚀 2.99x faster)
1024 15.23 us (✅ 1.00x) 3.24 us (🚀 4.70x faster) 5.06 us (🚀 3.01x faster)
2048 30.43 us (✅ 1.00x) 6.45 us (🚀 4.72x faster) 9.93 us (🚀 3.06x faster)

Dependencies

~28KB