diff --git a/Cargo.lock b/Cargo.lock index bc18ebc85def9..e5ad6cac3e197 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -561,17 +561,6 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "auto-hash-map" version = "0.1.0" @@ -1154,18 +1143,6 @@ dependencies = [ "half 2.4.1", ] -[[package]] -name = "clap" -version = "3.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" -dependencies = [ - "bitflags 1.3.2", - "clap_lex 0.2.4", - "indexmap 1.9.3", - "textwrap", -] - [[package]] name = "clap" version = "4.5.2" @@ -1184,7 +1161,7 @@ checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", - "clap_lex 0.7.0", + "clap_lex", "strsim 0.11.0", "terminal_size", ] @@ -1195,7 +1172,7 @@ version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "885e4d7d5af40bfb99ae6f9433e292feac98d452dcb3ec3d25dfe7552b77da8c" dependencies = [ - "clap 4.5.2", + "clap", ] [[package]] @@ -1210,15 +1187,6 @@ dependencies = [ "syn 2.0.58", ] -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "clap_lex" version = "0.7.0" @@ -1231,6 +1199,30 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" +[[package]] +name = "codspeed" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a104ac948e0188b921eb3fcbdd55dcf62e542df4c7ab7e660623f6288302089" +dependencies = [ + "colored", + "libc", + "serde_json", +] + +[[package]] +name = "codspeed-criterion-compat" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "722c36bdc62d9436d027256ce2627af81ac7a596dfc7d13d849d0d212448d7fe" +dependencies = [ + "codspeed", + "colored", + "criterion", + "futures", + "tokio", +] + [[package]] name = "color_quant" version = "1.1.0" @@ -1243,6 +1235,16 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + [[package]] name = "combine" version = "4.6.7" @@ -1541,20 +1543,20 @@ dependencies = [ [[package]] name = "criterion" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" dependencies = [ "anes", - "atty", "cast", "ciborium", - "clap 3.2.25", + "clap", "criterion-plot", "futures", + "is-terminal", "itertools 0.10.5", - "lazy_static", "num-traits", + "once_cell", "oorandom", "plotters", "rayon", @@ -2745,15 +2747,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.2" @@ -3183,6 +3176,17 @@ dependencies = [ "syn 2.0.58", ] +[[package]] +name = "is-terminal" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +dependencies = [ + "hermit-abi 0.4.0", + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "is_debug" version = "1.0.1" @@ -4290,7 +4294,7 @@ name = "node-file-trace" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.2", + "clap", "console-subscriber", "serde", "serde_json", @@ -4556,12 +4560,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "os_str_bytes" -version = "6.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" - [[package]] name = "ouroboros" version = "0.17.2" @@ -5270,7 +5268,7 @@ dependencies = [ "built", "cc", "cfg-if", - "clap 4.5.2", + "clap", "clap_complete", "console", "const_fn_assert", @@ -6538,7 +6536,7 @@ name = "swc-ast-explorer" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.2", + "clap", "owo-colors 3.5.0", "regex", "swc_core", @@ -8556,7 +8554,7 @@ name = "turbo-static" version = "0.1.0" dependencies = [ "bincode", - "clap 4.5.2", + "clap", "ctrlc", "ignore", "itertools 0.10.5", @@ -8670,6 +8668,7 @@ dependencies = [ "auto-hash-map", "bitflags 1.3.2", "bytes", + "codspeed-criterion-compat", "concurrent-queue", "criterion", "dashmap", @@ -8757,6 +8756,7 @@ version = "0.1.0" dependencies = [ "anyhow", "auto-hash-map", + "codspeed-criterion-compat", "concurrent-queue", "criterion", "dashmap", @@ -8802,6 +8802,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-recursion", + "codspeed-criterion-compat", "criterion", "difference", "futures", @@ -8838,6 +8839,7 @@ version = "0.1.0" dependencies = [ "anyhow", "chromiumoxide", + "codspeed-criterion-compat", "criterion", "futures", "nix 0.26.4", @@ -8884,7 +8886,8 @@ name = "turbopack-cli" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.2", + "clap", + "codspeed-criterion-compat", "console-subscriber", "criterion", "dunce", @@ -8923,7 +8926,7 @@ name = "turbopack-cli-utils" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.2", + "clap", "crossterm 0.26.1", "owo-colors 3.5.0", "serde", @@ -8970,7 +8973,7 @@ name = "turbopack-create-test-app" version = "0.1.0" dependencies = [ "anyhow", - "clap 4.5.2", + "clap", "indoc", "pathdiff", "serde_json", @@ -9044,6 +9047,7 @@ version = "0.1.0" dependencies = [ "anyhow", "async-trait", + "codspeed-criterion-compat", "criterion", "either", "indexmap 1.9.3", diff --git a/Cargo.toml b/Cargo.toml index 73a5e167d570f..cbd205f72d8f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -133,10 +133,11 @@ atty = "0.2.14" bytes = "1.1.0" chrono = "0.4.23" clap = { version = "4.5.2", features = ["derive"] } +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" } diff --git a/turbopack/crates/turbo-tasks-fs/Cargo.toml b/turbopack/crates/turbo-tasks-fs/Cargo.toml index c2d63dca2bf6d..e8830b28cca48 100644 --- a/turbopack/crates/turbo-tasks-fs/Cargo.toml +++ b/turbopack/crates/turbo-tasks-fs/Cargo.toml @@ -50,6 +50,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" diff --git a/turbopack/crates/turbo-tasks-fs/benches/mod.rs b/turbopack/crates/turbo-tasks-fs/benches/mod.rs index ec5a14eba482e..be3d045e473c4 100644 --- a/turbopack/crates/turbo-tasks-fs/benches/mod.rs +++ b/turbopack/crates/turbo-tasks-fs/benches/mod.rs @@ -5,7 +5,7 @@ use std::{ time::{Duration, Instant}, }; -use criterion::{ +use codspeed_criterion_compat::{ criterion_group, criterion_main, measurement::{Measurement, WallTime}, BenchmarkId, Criterion, diff --git a/turbopack/crates/turbo-tasks-memory/Cargo.toml b/turbopack/crates/turbo-tasks-memory/Cargo.toml index bc4f2f0d96963..9e2a272c819f8 100644 --- a/turbopack/crates/turbo-tasks-memory/Cargo.toml +++ b/turbopack/crates/turbo-tasks-memory/Cargo.toml @@ -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"] } diff --git a/turbopack/crates/turbo-tasks-memory/benches/mod.rs b/turbopack/crates/turbo-tasks-memory/benches/mod.rs index 6bbaf50152aa7..11585e9b01b31 100644 --- a/turbopack/crates/turbo-tasks-memory/benches/mod.rs +++ b/turbopack/crates/turbo-tasks-memory/benches/mod.rs @@ -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; diff --git a/turbopack/crates/turbo-tasks-memory/benches/scope_stress.rs b/turbopack/crates/turbo-tasks-memory/benches/scope_stress.rs index 8e406a25a25f1..77d7128f9ac81 100644 --- a/turbopack/crates/turbo-tasks-memory/benches/scope_stress.rs +++ b/turbopack/crates/turbo-tasks-memory/benches/scope_stress.rs @@ -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; diff --git a/turbopack/crates/turbo-tasks-memory/benches/stress.rs b/turbopack/crates/turbo-tasks-memory/benches/stress.rs index 31040560e46a9..3b66deabc77e1 100644 --- a/turbopack/crates/turbo-tasks-memory/benches/stress.rs +++ b/turbopack/crates/turbo-tasks-memory/benches/stress.rs @@ -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; diff --git a/turbopack/crates/turbopack-bench/Cargo.toml b/turbopack/crates/turbopack-bench/Cargo.toml index 3646b0bba790e..f18f4ee546a0e 100644 --- a/turbopack/crates/turbopack-bench/Cargo.toml +++ b/turbopack/crates/turbopack-bench/Cargo.toml @@ -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 } diff --git a/turbopack/crates/turbopack-bench/benches/mod.rs b/turbopack/crates/turbopack-bench/benches/mod.rs index fbb66c36f6d96..0c4f29d8ee3dc 100644 --- a/turbopack/crates/turbopack-bench/benches/mod.rs +++ b/turbopack/crates/turbopack-bench/benches/mod.rs @@ -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> { diff --git a/turbopack/crates/turbopack-bench/src/lib.rs b/turbopack/crates/turbopack-bench/src/lib.rs index 4e3df12db039f..c24ac62ec798b 100644 --- a/turbopack/crates/turbopack-bench/src/lib.rs +++ b/turbopack/crates/turbopack-bench/src/lib.rs @@ -10,7 +10,7 @@ use std::{ }; use anyhow::{anyhow, Context, Result}; -use criterion::{ +use codspeed_criterion_compat::{ measurement::{Measurement, WallTime}, BenchmarkGroup, BenchmarkId, Criterion, }; diff --git a/turbopack/crates/turbopack-bench/src/util/mod.rs b/turbopack/crates/turbopack-bench/src/util/mod.rs index cf9b317a96b81..c03e9703c94a3 100644 --- a/turbopack/crates/turbopack-bench/src/util/mod.rs +++ b/turbopack/crates/turbopack-bench/src/util/mod.rs @@ -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; @@ -155,7 +157,7 @@ pub trait AsyncBencherExtension { TF: Future; } -impl<'a, 'b, A: AsyncExecutor> AsyncBencherExtension for AsyncBencher<'a, 'b, A, WallTime> { +impl<'a, 'b, A: AsyncExecutor> AsyncBencherExtension for AsyncBencher<'a, 'b, A> { fn try_iter_custom(&mut self, routine: R) where R: Fn(u64, WallTime) -> F, diff --git a/turbopack/crates/turbopack-cli/Cargo.toml b/turbopack/crates/turbopack-cli/Cargo.toml index 449b0ad4d0a56..e2f3facf7b5c5 100644 --- a/turbopack/crates/turbopack-cli/Cargo.toml +++ b/turbopack/crates/turbopack-cli/Cargo.toml @@ -72,6 +72,7 @@ turbopack-trace-utils = { workspace = true } webbrowser = { workspace = true } [dev-dependencies] +codspeed-criterion-compat = { workspace = true, features = ["async_tokio"] } criterion = { workspace = true, features = ["async_tokio"] } regex = { workspace = true } turbopack-bench = { workspace = true } diff --git a/turbopack/crates/turbopack-cli/benches/mod.rs b/turbopack/crates/turbopack-cli/benches/mod.rs index 7236f5cc340b7..aed0ac9cc31ab 100644 --- a/turbopack/crates/turbopack-cli/benches/mod.rs +++ b/turbopack/crates/turbopack-cli/benches/mod.rs @@ -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; mod bundler; diff --git a/turbopack/crates/turbopack-ecmascript/Cargo.toml b/turbopack/crates/turbopack-ecmascript/Cargo.toml index def9af1d8e19a..ac651094c8a0c 100644 --- a/turbopack/crates/turbopack-ecmascript/Cargo.toml +++ b/turbopack/crates/turbopack-ecmascript/Cargo.toml @@ -67,6 +67,7 @@ swc_core = { workspace = true, features = [ ] } [dev-dependencies] +codspeed-criterion-compat = { workspace = true, features = ["async_tokio"] } criterion = { workspace = true, features = ["async_tokio"] } #rstest = { workspace = true } turbo-tasks-memory = { workspace = true } diff --git a/turbopack/crates/turbopack-ecmascript/benches/analyzer.rs b/turbopack/crates/turbopack-ecmascript/benches/analyzer.rs index de3bd88d872e9..aaf435017e954 100644 --- a/turbopack/crates/turbopack-ecmascript/benches/analyzer.rs +++ b/turbopack/crates/turbopack-ecmascript/benches/analyzer.rs @@ -1,6 +1,6 @@ use std::{fs, path::PathBuf, sync::Arc, time::Duration}; -use criterion::{Bencher, BenchmarkId, Criterion}; +use codspeed_criterion_compat::{Bencher, BenchmarkId, Criterion}; use swc_core::{ common::{FilePathMapping, Mark, SourceMap, GLOBALS}, ecma::{ diff --git a/turbopack/crates/turbopack-ecmascript/benches/mod.rs b/turbopack/crates/turbopack-ecmascript/benches/mod.rs index 48208446e41e4..8956bd3c76b38 100644 --- a/turbopack/crates/turbopack-ecmascript/benches/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/benches/mod.rs @@ -1,4 +1,4 @@ -use criterion::{criterion_group, criterion_main}; +use codspeed_criterion_compat::{criterion_group, criterion_main}; mod analyzer; diff --git a/turbopack/crates/turbopack/Cargo.toml b/turbopack/crates/turbopack/Cargo.toml index ff161cc2c61c2..5534ec589e097 100644 --- a/turbopack/crates/turbopack/Cargo.toml +++ b/turbopack/crates/turbopack/Cargo.toml @@ -42,6 +42,7 @@ turbopack-static = { workspace = true } turbopack-wasm = { workspace = true } [dev-dependencies] +codspeed-criterion-compat = { workspace = true, features = ["async_tokio"] } criterion = { workspace = true, features = ["async_tokio"] } difference = "2.0" futures = { workspace = true } diff --git a/turbopack/crates/turbopack/benches/mod.rs b/turbopack/crates/turbopack/benches/mod.rs index b1d1f6d977a1f..83ee815539f19 100644 --- a/turbopack/crates/turbopack/benches/mod.rs +++ b/turbopack/crates/turbopack/benches/mod.rs @@ -1,4 +1,4 @@ -use criterion::{criterion_group, criterion_main}; +use codspeed_criterion_compat::{criterion_group, criterion_main}; mod node_file_trace; diff --git a/turbopack/crates/turbopack/benches/node_file_trace.rs b/turbopack/crates/turbopack/benches/node_file_trace.rs index 7c38298b5c4f7..3bd491e1f1197 100644 --- a/turbopack/crates/turbopack/benches/node_file_trace.rs +++ b/turbopack/crates/turbopack/benches/node_file_trace.rs @@ -1,8 +1,8 @@ use std::{collections::HashMap, fs, path::PathBuf}; -use criterion::{Bencher, BenchmarkId, Criterion}; +use codspeed_criterion_compat::{Bencher, BenchmarkId, Criterion}; use regex::Regex; -use turbo_tasks::{RcStr, ReadConsistency, TurboTasks, Value, Vc}; +use turbo_tasks::{vdbg, RcStr, ReadConsistency, TurboTasks, Value, Vc}; use turbo_tasks_fs::{DiskFileSystem, FileSystem, NullFileSystem}; use turbo_tasks_memory::MemoryBackend; use turbopack::{