#compact #mutable #small #byte #memory

compact_bytes

A memory efficient bytes container that transparently stores bytes on the stack, when possible

6 releases

new 0.2.0 May 19, 2025
0.1.4 Apr 25, 2025
0.1.3 Jun 7, 2024
0.1.2 May 31, 2024
0.1.0 Oct 31, 2023

#699 in Encoding

Download history 2144/week @ 2025-01-28 4789/week @ 2025-02-04 2578/week @ 2025-02-11 2006/week @ 2025-02-18 3768/week @ 2025-02-25 2468/week @ 2025-03-04 2283/week @ 2025-03-11 2265/week @ 2025-03-18 1867/week @ 2025-03-25 2037/week @ 2025-04-01 2897/week @ 2025-04-08 2381/week @ 2025-04-15 2524/week @ 2025-04-22 1943/week @ 2025-04-29 2499/week @ 2025-05-06 1641/week @ 2025-05-13

9,001 downloads per month
Used in 7 crates (via merde_core)

MIT/Apache

58KB
1K SLoC

compact_bytes

A memory efficient bytes container that can store up to 23 bytes on the stack.




Note from the Maintainer

This crate was mostly developed for Materialize out of a need for a more compact bytes container. It entirely borrows implementation from compact_str which has been thoughtfully maintained over the past few years by a number of dedicated contributors, including:

For now this repository exists separately from compact_str because it's easier to get started that way. But the plan is to eventually merge the two.

Dependencies

~130–355KB