NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #1598 most downloaded on crates.io
Efficient string interner with minimal memory footprint and fast access to the underlying strings.
Last release 5 months ago
30 Apr 2026
Release timing varies
gaps range from 2 months to 2.3 years
Some releases are documented
notes for 16 of 27 stable releases
8 versions withdrawn
withdrawn after publishing
10 years old
35 releases · first in 2017
Fixed off-by-one bug in serde support. [#91]
Nothing published for this version
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Update hashbrown dependency from version 0.9 to version 0.11.
Update hashbrown dependency from version 0.9 to version 0.11.
Add shrink_to_fit method to StringInterner via backend. (#36)
Add support more than 4G of interned strings with StringBackend. (#37)
Remove S: Symbol trait bound from interner backends.
Remove S: Symbol trait bound from Clone impl for StringBackend.
Reworked the memory and allocation tests
cargo test -- --test-threads 1CI now tests the whole build for windows, linux (ubuntu) and macos.
Add cargo-audit and cargo-outdated checks to CI pipeline.
Remove no longer needed jemalloc dev-dependency.
Ensure cloned StringInterner can still look up the same symbols. #34 (Thanks @alamb)
StringInterner can still look up the same symbols.
#34 (Thanks @alamb)
BuildHasher: Clone trait bound for StringInterner's Clone impl.The BucketBackend now implements Send + Sync.
BucketBackend now implements Send + Sync.hashbrown 0.8 -> 0.9cfg-if 0.1 -> 1.0Make DefaultBackend generic over its symbol type.
DefaultBackend generic over its symbol type.
StringInterner<usize> is now possible to write (again).backends crate feature.
string-interner crate.Add Symbol implementation for usize.
Symbol implementation for usize.Add new StringBackend that is optimized for memory allocations and footprint.
StringBackend that is optimized for memory allocations and footprint.
Special thanks to Ten0 for help with this release!
Special thanks to Ten0 for help with this release!
unsafe in Symbol::try_from_usize methods.unsafe impls for Send and Sync for StringInterner.more-inline that puts more #[inline] on public methods.
more-inline crate feature is enabled by default. If you want to
turn it off use --no-default-features.more-inline also enables hashbrown/more-inline.&B: IntoIter trait bound from Clone impl of StringInternerThanks a lot (again) to CAD97 who is the vanguard of the technical improvements in this release with their blog post.
Thanks a lot (again) to CAD97 who is the vanguard of the technical improvements in this release with their blog post.
StringInterner's memory consumption independend
from the used internment backend.StringInterner's throughput for interning strings.Backend trait:
intern is no longer unsafeintern returns S (symbol type) instead of (InternedStr, S)intern_staticunsafe fn resolve_unchecked which does the same as resolve
but explicitely without bounds checkingbackend::InternedStr typehashbrown a mandatory dependency.
Note: We depend on it for the moment for its raw_entry API that has not yet been
stabilized for Rust. Also benchmarks show that it is 20-30% faster than Rust's
hashmap implementation.FxBuildHasher as build hasher.Allow to intern &'static str using get_or_intern_static API.
&'static str using get_or_intern_static API.
SymbolU16 and SymbolU32 that instantiating them with values
greater or equal to u16::MAX or u32::MAX respectively caused them to
panic instead of returning None.
Special thanks to CAD97 who motivated me to craft this release through their blog post "String interners in Rust". Also I want to thank matklad who wr
Special thanks to CAD97 who motivated me to craft this
release through their blog post
"String interners in Rust".
Also I want to thank matklad who wrote a nice
blog post
that inspired the design of the new BucketBackend for StringInterner.
Implement pluggable backends for StringInterner.
Uses the new BucketBackend by default which results in significant
performance boosts and lower memory consumption as well as fewer overall
memory allocations.
This makes it possible for dependencies to alter the behavior of internment.
The string-interner crate comes with 2 predefined backends:
SimpleBackend: Which is how the StringInterner of previous versions
worked by default. It performs one allocation per interned string.BucketBackend: Tries to minimize memory allocations and packs
interned strings densely. This is the new default behavior for this crate.Due to the above introduction of backends some APIs have been removed:
reservecapacityiter module
StringInterer's interned strings
and their symbols is still possible if the used backend supports
iteration.resolve_unchecked: Has no replacement, yet but might be reintroduced
in future versions again.shrink_to_fit: The API design was never really a good fit for interners.Remove Ord trait bound from Symbol trait
Ord trait bound from Symbol trait
Symbol::from_usize(usize) -> Self to Symbol::try_from_usize(usize) -> Option<Self>DefaultSymbol::try_from_usizeiter sub modulesymbol sub moduleSymbolU16: 16-bit wide symbolSymbolU32: 32-bit wide symbol (default)SymbolUsize: same size as usizeMake it possible to use this crate in no_std environments
no_std environments
hashbrown crate feature together with no_stdSym to DefaultSymbolIntoIterator impl for &StringInterner#[inline] annotations which improve performance for queriesPin self-referentials now)CRITICAL fix use after free bug in StringInterner::clone()
StringInterner::clone()std::iter::Extend for StringInternerSym::from_usize now avoids using unsafe codeFromIterator impl of StringInternerThanks YOSHIOKA Takuma for implementing this release.
release of version 0.7.0
release of version 0.7.0
Symbol for types that are From<usize> and Into<usize>StringInterner::clear API since its usage breaks invariantsStringInterner::{capacity, reserve} APIsSym that is a thin wrapper around NonZeroU32 (idea by [koute][gh-user-koute])DefaultStringInterner a type alias for the new StringInterner<Sym>FromIterator impl to StringInterner<S: Sym>html_root_url to crate rootThanks [matklad][gh-user-madklad] for suggestions and impulses
CRITICAL: fix use after free bug in StringInterner::clone implementation.
StringInterner::clone implementation.fixed a bug that StringInterner's Send impl didn't respect its generic HashBuilder parameter. Fixes GitHub [issue #4][gh-issue-4].
StringInterner's Send impl didn't respect its generic HashBuilder parameter. Fixes GitHub [issue #4][gh-issue-4].added shrink_to_fit public method to StringInterner - (by artemshein)
shrink_to_fit public method to StringInterner - (by artemshein)fixed a bug that inserting non-owning string types (e.g. str) was broken due to dangling pointers (Thanks to artemshein for fixing it!)
str) was broken due to dangling pointers (Thanks to artemshein for fixing it!)added optional serde serialization and deserialization support
PartialEq implementation for StringInternerStringInterner generic over BuildHasher to allow for custom hashersadded IntoIterator trait implementation for StringInterner
IntoIterator trait implementation for StringInternerremoved restrictive constraint for Unsigned for Symbol
Unsigned for Symboladded Send and Sync to InternalStrRef to make StringInterner itself Send and Sync
Send and Sync to InternalStrRef to make StringInterner itself Send and SyncNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
[gh-user-koute]: https://github.com/koute [gh-user-madklad]: https://github.com/matklad
Your coding agent can read these notes before it upgrades. Set up the MCP server →