Crates.io | kstring |
lib.rs | kstring |
version | 2.0.2 |
source | src |
created_at | 2020-03-16 20:53:39.275724 |
updated_at | 2024-07-25 13:52:17.503818 |
description | Key String: optimized for map keys |
homepage | |
repository | https://github.com/cobalt-org/kstring |
max_upload_size | |
id | 219582 |
size | 111,487 |
Key String: Optimized for map keys.
Considerations:
Ramifications:
&'static str
across strings (KString
),
references (KStringRef
), and lifetime abstractions (KStringCow
) to avoid
allocating for struct field names.Box<str>
rather than String
to use less memory.Features
max_inline
: Instead of aligning the inline-string for performance (15 bytes + length on 64-bit), use the full width (22 bytes on 64-bit)arc
: Instead of using Box<str>
, use Arc<str>
. Note: allocations are fast enough that this can actually slow things down for small enough strings.Alternatives, see string-benchmarks-rs
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.