Announcing `compact_str` version 0.3! A small string optimization for Rust
Hey folks, I'm announcing version 0.3 of a library I've been working on called compact_str! This library exports a single struct, CompactStr, which is a string type that stores short strings (strings <= 24 bytes) on the stack, and transparently stores longer strings on the heap. Aka a "small string optimization".
This release comes with several improvements to the library including:
- Mutability, you can now "push" and "pop" characters onto the string
- Ergonomics, the
FromIteratorandExtendtraits have been implemented, which make it easier to construct and update aCompactStr - Performance, creating a
CompactStris now faster than ever! - Efficiency, you can now inline strings that are 24 characters long, without the previous limitation of the first character needing to be ASCII
- Testing, expanded testing across more platforms, added fuzz testing with
libFuzzerandAFL++, and added testing withmiri