Crates.io | byteview |
lib.rs | byteview |
version | 0.2.0 |
source | src |
created_at | 2024-08-23 13:29:24.237596 |
updated_at | 2024-08-25 18:18:36.870981 |
description | Thin, immutable zero-copy slice type |
homepage | |
repository | https://github.com/marvin-j97/byteview |
max_upload_size | |
id | 1349159 |
size | 39,065 |
An immutable byte slice that may be inlined, and can be partially cloned without heap allocation.
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 500k "helloworld".repeat(1000)
(len=10'000) strings:
Struct | Memory Usage |
---|---|
Arc<[u8]> |
5 GB |
tokio::Bytes |
5 GB |
ByteView |
5 GB |