Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.89 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.89 KB

byteview

CI CI docs.rs Crates.io MSRV

An immutable byte slice that may be inlined, and can be partially cloned without heap allocation.

Memory layout

Memory usage

Allocating 200M "" (len=0) strings:

Struct Memory Usage
Arc<[u8]> 9.6 GB
tokio::Bytes 6.4 GB
ByteView 4.8 GB

Allocating 200M "helloworld" (len=10) strings:

Struct Memory Usage
Arc<[u8]> 12.8 GB
tokio::Bytes 12.8 GB
ByteView 4.8 GB

Allocating 100M "helloworldhelloworld" (len=20) strings:

Struct Memory Usage
Arc<[u8]> 6.4 GB
tokio::Bytes 6.4 GB
ByteView 2.4 GB

Allocating 50M "helloworldhelloworldhelloworldhelloworld" (len=30) strings:

Struct Memory Usage
Arc<[u8]> 4.0 GB
tokio::Bytes 4.0 GB
ByteView 3.6 GB

Allocating 500k "helloworld".repeat(1000) (len=10'000) strings:

Struct Memory Usage
Arc<[u8]> 5 GB
tokio::Bytes 5 GB
ByteView 5 GB

Run fuzz tests

cargo +nightly fuzz run fuzz_target_1