Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ref(benches): Describe more ways of running benchmarks #483

Merged
merged 2 commits into from
Nov 10, 2022
Merged
Changes from 1 commit
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
13 changes: 11 additions & 2 deletions iroh-p2p/benches/lru_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@
//!
//! # Running the benchmarks
//!
//! Install `cargo-criterion`:
//! You can run the benchmarks using either by directly using cargo:
flub marked this conversation as resolved.
Show resolved Hide resolved
//!
//! ```shell
//! cargo bench -p iroh-p2p
//! ```
//!
//! Or by installing `cargo-criterion`, which gives you slightly prettier output:
//!
//! ```shell
//! cargo install cargo-criterion
Expand All @@ -20,7 +26,10 @@
use criterion::{criterion_group, criterion_main, BatchSize, Criterion};
use libp2p::PeerId;

// The size of the cache to make. Taken from behaviour::peer_manager::DEFAULT_BAD_PEER_CAP.
/// The size of the cache to make.
///
/// Taken from behaviour::peer_manager::DEFAULT_BAD_PEER_CAP, but that's not `pub` (nor does
/// it need to be).
const CACHE_SIZE: usize = 10 * 4096;

fn bench_contains_empty(c: &mut Criterion) {
Expand Down