forked from tokio-rs/tracing
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dp-target-is-cow' into dp-event-non-static-metadata
* dp-target-is-cow: subscriber: remove TraceLogger (tokio-rs#1052) subscriber: make Registry::enter/exit much faster (tokio-rs#1058) Use impl Into<Cow<'a, str> chore(deps): update env_logger requirement from 0.7 to 0.8 (tokio-rs#1050) No need for extra lifetime Add constructor for dynamic data chore: fix tracing-macros::dbg (tokio-rs#1054) Feature gate usage of Cow in Metadata chore(deps): update pin-project requirement from 0.4 to 1.0 (tokio-rs#1038) chore: remove duplicated section from tracing/README.md (tokio-rs#1046)
- Loading branch information
Showing
13 changed files
with
187 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,3 +84,7 @@ harness = false | |
[[bench]] | ||
name = "fmt" | ||
harness = false | ||
|
||
[[bench]] | ||
name = "enter" | ||
harness = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
use criterion::{criterion_group, criterion_main, Criterion}; | ||
use tracing_subscriber::prelude::*; | ||
|
||
fn enter(c: &mut Criterion) { | ||
let mut group = c.benchmark_group("enter"); | ||
let _subscriber = tracing_subscriber::fmt() | ||
.with_max_level(tracing::Level::INFO) | ||
.finish() | ||
.set_default(); | ||
group.bench_function("enabled", |b| { | ||
let span = tracing::info_span!("foo"); | ||
b.iter_with_large_drop(|| span.enter()) | ||
}); | ||
group.bench_function("disabled", |b| { | ||
let span = tracing::debug_span!("foo"); | ||
b.iter_with_large_drop(|| span.enter()) | ||
}); | ||
} | ||
|
||
fn enter_exit(c: &mut Criterion) { | ||
let mut group = c.benchmark_group("enter_exit"); | ||
let _subscriber = tracing_subscriber::fmt() | ||
.with_max_level(tracing::Level::INFO) | ||
.finish() | ||
.set_default(); | ||
group.bench_function("enabled", |b| { | ||
let span = tracing::info_span!("foo"); | ||
b.iter(|| span.enter()) | ||
}); | ||
group.bench_function("disabled", |b| { | ||
let span = tracing::debug_span!("foo"); | ||
b.iter(|| span.enter()) | ||
}); | ||
} | ||
|
||
fn enter_many(c: &mut Criterion) { | ||
let mut group = c.benchmark_group("enter_many"); | ||
let _subscriber = tracing_subscriber::fmt() | ||
.with_max_level(tracing::Level::INFO) | ||
.finish() | ||
.set_default(); | ||
group.bench_function("enabled", |b| { | ||
let span1 = tracing::info_span!("span1"); | ||
let _e1 = span1.enter(); | ||
let span2 = tracing::info_span!("span2"); | ||
let _e2 = span2.enter(); | ||
let span3 = tracing::info_span!("span3"); | ||
let _e3 = span3.enter(); | ||
let span = tracing::info_span!("foo"); | ||
b.iter_with_large_drop(|| span.enter()) | ||
}); | ||
group.bench_function("disabled", |b| { | ||
let span1 = tracing::info_span!("span1"); | ||
let _e1 = span1.enter(); | ||
let span2 = tracing::info_span!("span2"); | ||
let _e2 = span2.enter(); | ||
let span3 = tracing::info_span!("span3"); | ||
let _e3 = span3.enter(); | ||
let span = tracing::debug_span!("foo"); | ||
b.iter_with_large_drop(|| span.enter()) | ||
}); | ||
} | ||
criterion_group!(benches, enter, enter_exit, enter_many); | ||
criterion_main!(benches); |
Oops, something went wrong.