Repository: vercel/next.js
Pull request: Turbopack: vendor analysis benchmarks

These files might change or move

Closes PACK-5367

Changed files:
filename: .ignore
patch: @@ -1,6 +1,8 @@
 # Ignore these files in tools like grep, rg, ast-grep, etc. These files should
 # *not* be ignored by git.
 
+packages/next/src/compiled
+turbopack/crates/turbopack-ecmascript/tests/benches/*
+
 # Not valid text
 turbopack/crates/turbopack-tests/tests/execution/turbopack/basic/error/input/broken.js
-packages/next/src/compiled

filename: .prettierignore
patch: @@ -60,6 +60,7 @@ test/e2e/async-modules/amp-validator-wasm.js
 /turbopack/crates/*/js/src/compiled
 /turbopack/crates/turbopack/bench.json
 /turbopack/crates/turbopack-ecmascript/tests/analyzer/graph
+/turbopack/crates/turbopack-ecmascript/tests/benches
 /turbopack/crates/turbopack-ecmascript/tests/tree-shaker
 /turbopack/crates/next-transform-strip-page-exports/tests
 /turbopack/crates/next-transform-dynamic/tests
@@ -86,4 +87,4 @@ test/production/app-dir/symbolic-file-links/src/app/page.tsx
 turbopack/crates/turbopack/tests/node-file-trace/integration/pnpm/node_modules/foo
 turbopack/crates/turbopack/tests/node-file-trace/integration/pnpm/node_modules/.pnpm/foo@2.1.0/node_modules/lodash-pnpm-test
 turbopack/crates/turbopack/tests/node-file-trace/integration/symlink-to-file/linked.js
-turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/node_modules/component
\ No newline at end of file
+turbopack/crates/turbopack-tests/tests/snapshot/swc_transforms/mono_transforms/input/node_modules/component

filename: turbopack/crates/turbopack-ecmascript/benches/references.rs
patch: @@ -38,7 +38,7 @@ pub fn benchmark(c: &mut Criterion) {
 
     let cases = rt
         .block_on(tt.run_once(async {
-            let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../../../");
+            let root_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("tests/benches/");
             let fs = DiskFileSystem::new(rcstr!("project"), root_dir.to_str().unwrap().into());
 
             let environment = Environment::new(ExecutionEnvironment::NodeJsLambda(
@@ -54,10 +54,12 @@ pub fn benchmark(c: &mut Criterion) {
 
             let mut cases = vec![];
             for (file, is_tracing) in [
-                (r#"packages/next/dist/compiled/babel-packages/packages-bundle.js"#, false),
-                (r#"packages/next/dist/compiled/babel-packages/packages-bundle.js"#, true),
-                (r#"node_modules/.pnpm/react-dom@19.2.0-canary-03fda05d-20250820_react@19.2.0-canary-03fda05d-20250820/node_modules/react-dom/cjs/react-dom-client.development.js"#, false),
-                (r#"node_modules/.pnpm/react-dom@19.2.0-canary-03fda05d-20250820_react@19.2.0-canary-03fda05d-20250820/node_modules/react-dom/cjs/react-dom-client.development.js"#, true),
+                (r#"packages-bundle.js"#, false),
+                (r#"packages-bundle.js"#, true),
+                (r#"app-page-turbo.runtime.prod.js"#, false),
+                (r#"app-page-turbo.runtime.prod.js"#, true),
+                (r#"react-dom-client.development.js"#, false),
+                (r#"react-dom-client.development.js"#, true),
             ] {
                 let module = EcmascriptModuleAsset::builder(
                     ResolvedVc::upcast(
@@ -79,7 +81,11 @@ pub fn benchmark(c: &mut Criterion) {
                 .to_resolved()
                 .await?;
 
-                cases.push((file.rsplit("/").next().unwrap(), if is_tracing { "tracing" } else { "full" }, module));
+                cases.push((
+                    file.rsplit("/").next().unwrap(),
+                    if is_tracing { "tracing" } else { "full" },
+                    module,
+                ));
             }
             anyhow::Ok(cases)
         }))
@@ -117,9 +123,11 @@ where
         .build()
         .unwrap();
 
-    b.to_async(rt).iter(|| {
+    b.to_async(rt).iter(async || {
         input
             .storage
             .run_once(analyse_ecmascript_module_internal(input.module, None))
+            .await
+            .unwrap()
     });
 }