blazinterner

Crates.ioblazinterner
lib.rsblazinterner
version0.1.0
created_at2026-01-17 20:47:51.774676+00
updated_at2026-01-17 20:47:51.774676+00
descriptionEfficient and concurrent interning of generic data
homepage
repositoryhttps://github.com/gendx/blazinterner
max_upload_size
id2051128
size51,962
Guillaume E (gendx)

documentation

README

Blazinterner: efficient and concurrent interning of generic data

Crate Documentation Minimum Rust 1.85.0 Lines of Code Dependencies License Codecov Build Status Test Status

Here are the main features offered by this crate.

  • Generic: You can intern any data type that implements Hash and Eq, not just strings. The interned type doesn't even have to be Sized (for example str), as long as you provide a Sized storage type (such as Box<str>) that can be borrowed as the interned type.
  • Efficient: Each Interned value contains only a 32-bit index. The corresponding Arena stores each value directly in an AppendVec, plus the 32-bit index in a raw hash table (DashTable). To intern a value of type T using storage type S, you can pass any type that implements Borrow<T> and Into<S>, which allows avoiding unnecessary copies. For example, in an Arena<str, Box<str>> you can intern many string types: &str, String, Box<str>, Cow<'_, str>, etc.
  • Concurrent: The Arena is Sync, and allows simultaneous reads and writes. More specifically, retrieving values via Interned::lookup() and Interned::lookup_ref() is always wait-free, even when a write happens concurrently! This is thanks to the underlying AppendVec implementation. However, only one write (using Interned::from()) can happen at a time on a given arena, due to an exclusive write lock.
Commit count: 7

cargo fmt