Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1,861 changes: 1,861 additions & 0 deletions sv2/codec-sv2/BENCHES.md

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions sv2/codec-sv2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ tracing = { workspace = true, optional = true }

[dev-dependencies]
key-utils = { workspace = true }
criterion = { workspace = true }
rayon-core = { workspace = true }
quickcheck = { workspace = true }
quickcheck_macros = { workspace = true }

Expand All @@ -32,3 +34,28 @@ tracing = ["dep:tracing"]

[package.metadata.docs.rs]
features = ["with_buffer_pool", "noise_sv2", "std"]


[[bench]]
name = "encoder"
harness = false

[[bench]]
name = "decoder"
harness = false

[[bench]]
name = "noise_roundtrip"
harness = false

[[bench]]
name = "serialization"
harness = false

[[bench]]
name = "buffer_exhaustion"
harness = false

[[bench]]
name = "pool_lifecycle"
harness = false
21 changes: 21 additions & 0 deletions sv2/codec-sv2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,24 @@ This crate provides two examples demonstrating how to encode and decode Sv2 fram
Encode and decode Sv2 frames with Noise protocol encryption, detailing the entire encryption
handshake and transport phase and serialization and transmission process for encrypted
communications.

## Benchmarks

Performance benchmarks are provided for all major code paths: plain encoding/decoding,
Noise protocol encryption, serialization, and buffer pool exhaustion behavior.

See **[BENCHES.md](BENCHES.md)** for the full benchmark suite documentation, including:
- How to run each suite and which feature flags are needed
- Descriptions of every benchmark target
- Measured results with and without `with_buffer_pool` / `noise_sv2`
- Analysis of buffer pool exhaustion thresholds and Alloc-mode overhead

Quick start:

```bash
# Run all benchmarks with all features
cargo bench --all-features

# Run only the pool exhaustion benchmarks
cargo bench --bench buffer_exhaustion
```
Loading
Loading