Unverified Commit 48e53d7d authored by Donny/강동윤's avatar Donny/강동윤 Committed by GitHub

chore(ci): Make turbopack benchmark less flaky (#79980)

### What?

Use mimalloc in the benchmark.

### Why?

I know it's a bit ridiculous, but using mimalloc stabilizes the benchmark. At least, it was the case for SWC.
parent 7973ff9d
...@@ -10157,6 +10157,7 @@ dependencies = [ ...@@ -10157,6 +10157,7 @@ dependencies = [
"turbo-tasks-build", "turbo-tasks-build",
"turbo-tasks-fs", "turbo-tasks-fs",
"turbo-tasks-hash", "turbo-tasks-hash",
"turbo-tasks-malloc",
"turbo-tasks-testing", "turbo-tasks-testing",
"turbopack-core", "turbopack-core",
"turbopack-resolve", "turbopack-resolve",
......
#![cfg_attr(not(codspeed), allow(unused))] #![cfg_attr(not(codspeed), allow(unused))]
extern crate turbo_tasks_malloc;
use std::{ use std::{
path::{Path, PathBuf}, path::{Path, PathBuf},
process::Command, process::Command,
}; };
use criterion::{Criterion, criterion_group, criterion_main}; use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use turbopack_cli::{ use turbopack_cli::{
arguments::{BuildArguments, CommonArguments}, arguments::{BuildArguments, CommonArguments},
register, register,
...@@ -47,7 +49,9 @@ fn bench_small_apps(c: &mut Criterion) { ...@@ -47,7 +49,9 @@ fn bench_small_apps(c: &mut Criterion) {
let mut g = c.benchmark_group("turbopack/build/apps"); let mut g = c.benchmark_group("turbopack/build/apps");
for app in apps { for app in apps {
g.bench_function(app.to_string_lossy().to_string(), |b| { g.bench_function(
BenchmarkId::new("build", app.file_name().unwrap().to_string_lossy()),
|b| {
let apps_dir = apps_dir.clone(); let apps_dir = apps_dir.clone();
let app = app.clone(); let app = app.clone();
...@@ -84,7 +88,8 @@ fn bench_small_apps(c: &mut Criterion) { ...@@ -84,7 +88,8 @@ fn bench_small_apps(c: &mut Criterion) {
}) })
.unwrap(); .unwrap();
}); });
}); },
);
} }
} }
......
...@@ -77,6 +77,7 @@ par-core = { workspace = true, features = ["rayon"] } ...@@ -77,6 +77,7 @@ par-core = { workspace = true, features = ["rayon"] }
[dev-dependencies] [dev-dependencies]
criterion = { workspace = true, features = ["async_tokio"] } criterion = { workspace = true, features = ["async_tokio"] }
turbo-tasks-backend = { workspace = true } turbo-tasks-backend = { workspace = true }
turbo-tasks-malloc = { workspace = true }
turbo-tasks-testing = { workspace = true } turbo-tasks-testing = { workspace = true }
[build-dependencies] [build-dependencies]
......
extern crate turbo_tasks_malloc;
use criterion::{criterion_group, criterion_main}; use criterion::{criterion_group, criterion_main};
mod analyzer; mod analyzer;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment