Small Strings in Rust: smolstr vs. smartstring

The author dives into comparing smolstr and smartstring for Rust programming, setting up a project with argh for arguments parsing. They showcase reading JSON data of the largest US cities, focusing on memory allocations using a custom tracing allocator. The author demonstrates handling events and peak memory usage with textplots and ByteSize libraries, leading to a report subcommand for analysis. The decision to save events to a file for processing in a separate subcommand is justified by simplicity, despite potential challenges with in-memory collection. The article concludes with a detailed breakdown of the reporter implementation.

https://fasterthanli.me/articles/small-strings-in-rust

To top