160 releases (18 breaking)

new 0.20.1 Nov 21, 2024
0.19.1 Nov 5, 2024
0.17.0 Jul 8, 2024
0.15.0-alpha.5 Mar 29, 2024
0.4.0 Mar 28, 2023

#565 in Data structures

Download history 12410/week @ 2024-08-03 12663/week @ 2024-08-10 13054/week @ 2024-08-17 9524/week @ 2024-08-24 7979/week @ 2024-08-31 8071/week @ 2024-09-07 6440/week @ 2024-09-14 7469/week @ 2024-09-21 4393/week @ 2024-09-28 5392/week @ 2024-10-05 7056/week @ 2024-10-12 5401/week @ 2024-10-19 5198/week @ 2024-10-26 6552/week @ 2024-11-02 6874/week @ 2024-11-09 6243/week @ 2024-11-16

25,422 downloads per month
Used in 70 crates (3 directly)

MIT/Apache

18KB
263 lines

Yet another string interning library

Part of the rerun family of crates.

Latest version Documentation MIT Apache

String interning is a way to reduce memory use by detecting duplicated string and storing them only once.

The main thing that makes this library different is that InternedString stores the hash of the string, which makes using it in lookups is really fast, especially when using nohash_hasher::IntMap.

The hash is assumed to be perfect, which means this library accepts the risk of hash collisions!

The interned strings are never freed, so don't intern too many things.


lib.rs:

Yet another string interning library.

The main thing that makes this library different is that InternedString stores the hash of the string, which makes using it in lookups is really fast, especially when using nohash_hasher::IntMap.

The hash is assumed to be perfect, which means this library accepts the risk of hash collisions!

The interned strings are never freed, so don't intern too many things.

Dependencies

~1.1–6MB
~26K SLoC