Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
60
third-party/vendor/tracy-client/benches/client.rs
vendored
Normal file
60
third-party/vendor/tracy-client/benches/client.rs
vendored
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
use criterion::{criterion_group, criterion_main, Criterion};
|
||||
use tracy_client::Client;
|
||||
|
||||
fn client_start(c: &mut Criterion) {
|
||||
let mut clients = Vec::<Client>::with_capacity(1_000_000_000);
|
||||
c.bench_function("start", |b| b.iter(|| clients.push(Client::start())));
|
||||
}
|
||||
|
||||
fn client_clone(c: &mut Criterion) {
|
||||
let mut clients = Vec::<Client>::with_capacity(1_000_000_000);
|
||||
let client = Client::start();
|
||||
c.bench_function("clone", |b| b.iter(|| clients.push(client.clone())));
|
||||
}
|
||||
|
||||
fn client_running(c: &mut Criterion) {
|
||||
let _client = Client::start();
|
||||
c.bench_function("running", |b| b.iter(|| Client::running()));
|
||||
}
|
||||
|
||||
fn ops_alloc(c: &mut Criterion) {
|
||||
let client = tracy_client::Client::start();
|
||||
c.bench_function("span_alloc_callstack/0", |bencher| {
|
||||
bencher.iter(|| {
|
||||
client
|
||||
.clone()
|
||||
.span_alloc("hello", "function", "file", 42, 0);
|
||||
});
|
||||
});
|
||||
c.bench_function("span_alloc_callstack/100", |bencher| {
|
||||
bencher.iter(|| {
|
||||
client
|
||||
.clone()
|
||||
.span_alloc("hello", "function", "file", 42, 100);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fn ops_static(c: &mut Criterion) {
|
||||
let _client = tracy_client::Client::start();
|
||||
c.bench_function("span_callstack/0", |bencher| {
|
||||
bencher.iter(|| {
|
||||
tracy_client::span!("some_name", 0);
|
||||
});
|
||||
});
|
||||
c.bench_function("span_callstack/100", |bencher| {
|
||||
bencher.iter(|| {
|
||||
tracy_client::span!("some_name", 100);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
criterion_group!(
|
||||
benches,
|
||||
client_start,
|
||||
client_clone,
|
||||
client_running,
|
||||
ops_alloc,
|
||||
ops_static
|
||||
);
|
||||
criterion_main!(benches);
|
||||
Loading…
Add table
Add a link
Reference in a new issue