Unverified Commit f8816b06 authored by Benjamin Woodruff's avatar Benjamin Woodruff Committed by GitHub

Turbopack: Only benchmark file IO on `next dev` (#84474)

I added this in https://github.com/vercel/next.js/pull/66057

It's too noisy and not useful on CI. CI machines are often multi-tenant and/or running many other processes during initialization.

We could check for `process.env.CI`, but I think just having the check in `next dev` is enough.

https://vercel.slack.com/archives/C01A2M9R8RZ/p1759349240395449
parent 6f2c6404
......@@ -455,9 +455,10 @@ pub fn project_new(
}
let options: ProjectOptions = options.into();
let is_dev = options.dev;
let container = turbo_tasks
.run(async move {
let project = ProjectContainer::new(rcstr!("next.js"), options.dev);
let project = ProjectContainer::new(rcstr!("next.js"), is_dev);
let project = project.to_resolved().await?;
project.initialize(options).await?;
Ok(project)
......@@ -465,24 +466,29 @@ pub fn project_new(
.or_else(|e| turbopack_ctx.throw_turbopack_internal_result(&e.into()))
.await?;
Handle::current().spawn({
let tt = turbo_tasks.clone();
async move {
let result = tt
.clone()
.run(async move {
benchmark_file_io(tt, container.project().node_root().owned().await?)
if is_dev {
Handle::current().spawn({
let tt = turbo_tasks.clone();
async move {
let result = tt
.clone()
.run(async move {
benchmark_file_io(
tt,
container.project().node_root().owned().await?,
)
.await
})
.await;
if let Err(err) = result {
// TODO Not ideal to print directly to stdout.
// We should use a compilation event instead to report async errors.
println!("Failed to benchmark file I/O: {err}");
})
.await;
if let Err(err) = result {
// TODO Not ideal to print directly to stdout.
// We should use a compilation event instead to report async errors.
println!("Failed to benchmark file I/O: {err}");
}
}
}
.instrument(tracing::info_span!("benchmark file I/O"))
});
.instrument(tracing::info_span!("benchmark file I/O"))
});
}
Ok(External::new(ProjectInstance {
turbopack_ctx,
......
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