1 个不稳定版本

新功能 0.2.0 2024 年 8 月 25 日
0.1.0 2024 年 8 月 23 日

#597数据结构

Download history · Rust 包仓库 226/week @ 2024-08-20 · Rust 包仓库

每月 226 次下载

MIT/Apache

29KB
629

byteview

CI CI docs.rs Crates.io MSRV

一个不可变的字节数组切片,可以内联,并且可以部分克隆而不需要堆分配。

Memory layout

内存使用

分配 200M 个 "helloworld" (len=10) 字符串

结构 内存使用
Arc<[u8]> 12.8 GB
tokio::Bytes 12.8 GB
ByteView 4.8 GB

分配 100M 个 "helloworldhelloworld" (len=20) 字符串

结构 内存使用
Arc<[u8]> 6.4 GB
tokio::Bytes 6.4 GB
ByteView 2.4 GB

分配 500k "helloworld".repeat(1000) (len=10'000) 字符串

结构 内存使用
Arc<[u8]> 5 GB
tokio::Bytes 5 GB
ByteView 5 GB

依赖项

~170KB