Announcing `compact_str` version 0.6! A small string optimization for Rust

This page summarizes the projects mentioned and recommended in the original post on /r/rust

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • compact_str

    A memory efficient string type that can store up to 24* bytes on the stack

  • Along with performance improvements, this release includes implementing multiple methods for CompactString, to bring its API nearly 1:1 with String. The only exception being methods that don't have a direct port for a small string optimization, e.g. into_bytes, or methods that aren't yet stable. A full change log can be found here.

  • string-rosetta-rs

    Comparison of Rust string types

  • SmolStr can online 22 characters and is immutable, but it is atomically ref counted so cloning is O(1). A good comparison of different string types can be found here

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • STC

    A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers. (by stclib)

  • Very cool! I have a similar implementation in C where max stack/short string length is 23 characters, as C strings need a null-terminator. The last byte represents length as 23 - len, so when len is 23, it doubles as the null terminator (and it's high bit as the sso discriminator).

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts