Skip to content

Commit

Permalink
Merge branch 'master' into nalgebra
Browse files Browse the repository at this point in the history
  • Loading branch information
gammelalf committed Jun 8, 2022
2 parents c7bc8be + 3553c84 commit f459fa9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@ smallvec = { version = "1.8" }

[dev-dependencies]
once_cell = "1.11"
pprof = { version = "0.9", features = ["flamegraph", "criterion"] }
pprof = { version = "0.9", features = ["flamegraph", "protobuf-codec", "criterion"] }
criterion = { version = "0.3", features = ["html_reports"] }

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

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

[[bench]]
name = "speed"
harness = false
8 changes: 6 additions & 2 deletions benches/flamegraph.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
use std::time::Duration;
///
/// Use the pprof-rs profiler outputting a svg flamegraph.
///
/// Needs to be called with `--profile-time=<seconds>`
///
use criterion::{criterion_group, criterion_main, Criterion};
use pprof::criterion::{PProfProfiler, Output};
mod common;

static SECOND: Duration = Duration::from_secs(1);
criterion_group!{
name = benches;
config = Criterion::default()
Expand Down
23 changes: 23 additions & 0 deletions benches/protobuf.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
///
/// Use the pprof-rs profiler outputting protobuf data.
///
/// Then use `go tool pprof` to render graphs from this data.
/// For example:
/// - `go tool pprof -svg profile.pb` for a flowchart
/// - `go tool pprof -http 127.0.0.1:8000` for an interactive view including flowchart and flamegraph
///
/// Needs to be called with `--profile-time=<seconds>`
///
use criterion::{criterion_group, criterion_main, Criterion};
use pprof::criterion::{PProfProfiler, Output};
mod common;

criterion_group!{
name = benches;
config = Criterion::default()
.with_profiler(PProfProfiler::new(100, Output::Protobuf))
;
targets = common::bezier::all
}
criterion_main!(benches);

0 comments on commit f459fa9

Please sign in to comment.