Crates.io | con-art-rust |
lib.rs | con-art-rust |
version | 0.2.0 |
source | src |
created_at | 2022-01-12 19:32:08.408058 |
updated_at | 2022-02-15 01:20:12.002926 |
description | A Rust implementation of ART-OLC concurrent adaptive radix tree. |
homepage | |
repository | https://github.com/XiangpengHao/con-art-rust |
max_upload_size | |
id | 512978 |
size | 100,904 |
A Rust implementation of ART-OLC concurrent adaptive radix tree. It implements the optimistic lock coupling with proper SIMD support.
It only supports (and is optimized for) 8 byte key; due to this specialization, this ART has great performance -- basic operations are ~40% faster than flurry hash table, range scan is an order of magnitude faster.
The code is extensively tested with {address|leak} sanitizer as well as libfuzzer.
Fast performance, faster than most hash tables.
Concurrent, super scalable, it reaches 150Mop/s on 32 cores.
Super low memory consumption. Hash tables often have exponential bucket size growth, which often lead to low load factors. ART is more space efficient.
use con_art_rust::Art;
let art = Art::new();
let guard = art.pin(); // enter an epoch
art.insert(0, 42, &guard); // insert a value
let val = art.get(&0).unwrap(); // read the value
assert_eq!(val, 42);
let mut scan_buffer = vec![0; 8];
let scan_result = art.range(&0, &10, &mut art_scan_buffer); // scan values
assert_eq!(scan_result.unwrap(), 1);