Skip to content

Commit

Permalink
add codspeed-criterion-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
ForsakenHarmony committed Aug 22, 2024
1 parent 1e6d204 commit de89ee6
Show file tree
Hide file tree
Showing 20 changed files with 89 additions and 76 deletions.
126 changes: 65 additions & 61 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,11 @@ atty = "0.2.14"
bytes = "1.1.0"
chrono = "0.4.23"
clap = "4.5.2"
codspeed-criterion-compat = "2.6.0"
concurrent-queue = "2.5.0"
console = "0.15.5"
console-subscriber = "0.1.8"
criterion = "0.4.0"
criterion = "0.5.1"
crossbeam-channel = "0.5.8"
dashmap = "5.4.0"
dhat = { version = "0.3.2" }
Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-fs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ turbo-tasks-hash = { workspace = true }
unicode-segmentation = { workspace = true }

[dev-dependencies]
codspeed-criterion-compat = { workspace = true, features = ["async_tokio"] }
criterion = { workspace = true, features = ["async_tokio"] }
rstest = { workspace = true }
sha2 = "0.10.2"
Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbo-tasks-fs/benches/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
time::{Duration, Instant},
};

use criterion::{
use codspeed_criterion_compat::{
criterion_group, criterion_main,
measurement::{Measurement, WallTime},
BenchmarkId, Criterion,
Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbo-tasks-memory/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ turbo-tasks-hash = { workspace = true }
turbo-tasks-malloc = { workspace = true, default-features = false }

[dev-dependencies]
codspeed-criterion-compat = { workspace = true, features = ["async_tokio"] }
criterion = { workspace = true, features = ["async_tokio"] }
loom = "0.7.2"
rand = { workspace = true, features = ["small_rng"] }
Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbo-tasks-memory/benches/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#![feature(arbitrary_self_types)]

use criterion::{criterion_group, criterion_main, Criterion};
use codspeed_criterion_compat::{criterion_group, criterion_main, Criterion};

pub(crate) mod scope_stress;
pub(crate) mod stress;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use criterion::{BenchmarkId, Criterion};
use codspeed_criterion_compat::{BenchmarkId, Criterion};
use turbo_tasks::{Completion, ReadConsistency, TryJoinIterExt, TurboTasks, Vc};
use turbo_tasks_memory::MemoryBackend;

Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbo-tasks-memory/benches/stress.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Result;
use criterion::{BenchmarkId, Criterion};
use codspeed_criterion_compat::{BenchmarkId, Criterion};
use turbo_tasks::{ReadConsistency, TryJoinIterExt, TurboTasks, Vc};
use turbo_tasks_memory::MemoryBackend;

Expand Down
1 change: 1 addition & 0 deletions turbopack/crates/turbopack-bench/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ anyhow = { workspace = true, features = ["backtrace"] }
chromiumoxide = { workspace = true, features = [
"tokio-runtime",
], default-features = false }
codspeed-criterion-compat = { workspace = true, features = ["async_tokio"] }
criterion = { workspace = true, features = ["async_tokio"] }
futures = { workspace = true }
once_cell = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbopack-bench/benches/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use criterion::{criterion_group, criterion_main, Criterion};
use codspeed_criterion_compat::{criterion_group, criterion_main, Criterion};
use turbopack_bench::bundlers::Bundler;

fn get_bundlers() -> Vec<Box<dyn Bundler>> {
Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbopack-bench/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::{
};

use anyhow::{anyhow, Context, Result};
use criterion::{
use codspeed_criterion_compat::{
measurement::{Measurement, WallTime},
BenchmarkGroup, BenchmarkId, Criterion,
};
Expand Down
6 changes: 4 additions & 2 deletions turbopack/crates/turbopack-bench/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ use chromiumoxide::{
browser::{Browser, BrowserConfig},
error::CdpError::Ws,
};
use criterion::{async_executor::AsyncExecutor, black_box, measurement::WallTime, AsyncBencher};
use codspeed_criterion_compat::{
async_executor::AsyncExecutor, black_box, measurement::WallTime, AsyncBencher,
};
use futures::{Future, StreamExt};
pub use page_guard::PageGuard;
use parking_lot::Mutex;
Expand Down Expand Up @@ -155,7 +157,7 @@ pub trait AsyncBencherExtension<A: AsyncExecutor> {
TF: Future<Output = ()>;
}

impl<'a, 'b, A: AsyncExecutor> AsyncBencherExtension<A> for AsyncBencher<'a, 'b, A, WallTime> {
impl<'a, 'b, A: AsyncExecutor> AsyncBencherExtension<A> for AsyncBencher<'a, 'b, A> {
fn try_iter_custom<R, F>(&mut self, routine: R)
where
R: Fn(u64, WallTime) -> F,
Expand Down
Loading

0 comments on commit de89ee6

Please sign in to comment.