Crates.io | hcstatic-str |
lib.rs | hcstatic-str |
version | 0.1.1 |
source | src |
created_at | 2023-06-20 21:19:57.278435 |
updated_at | 2023-06-20 21:37:39.602541 |
description | compact storage for short static strings |
homepage | |
repository | |
max_upload_size | |
id | 895499 |
size | 6,409 |
This crate is for storing static short strings (up to 256 bytes) in as compact a way as possible. Instead of each string getting it's own allocation, and associated padding, header, etc, they are stored packed into 1 MiB allocations. The length is stored in the allocation, making the stack size of the Str type 1 word instead of the usual 2 for &str. Because the length is limited to 256 bytes only one extra byte is used in the heap allocation for the length.