Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Turbopack benchmark for next@canary #8421

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions crates/turbopack-bench/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ and optionally filter the benchmarks run to specific bundlers, such as:
cargo bench -p turbopack-bench -p turbopack-cli -- "hmr_to_eval/(Turbopack CSR|Vite)"
```

or a specific suite:

```sh
cargo bench -p turbopack-bench -- "bench_hydration/Next\.js canary Turbo RSC"
```

**Note**: The Turbopack benchmark suite includes a mix of server-side rendered and client-only rendered examples -- these are reflected in "CSR" or "SSR" in the benchmark name. Turbopack supports both, while some other bundlers only support client-rendered examples. Take that into account when comparing CSR results against SSR.

**Hint**: These benchmarks take a long time to complete, since they try to capture at least 10 samples for every scenario. There is a `TURBOPACK_BENCH_PROGRESS=1` env var to show values while the benchmarks are running.
Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-bench/src/bundlers/nextjs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ impl NextJsVersion {
NextJsVersion::V12 => "^18.2.0",
NextJsVersion::V13 => "^18.2.0",
NextJsVersion::V14 => "^18.2.0",
NextJsVersion::Canary => "^18.2.0",
NextJsVersion::Canary => "rc",
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/turbopack-bench/src/util/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ pub fn build_test(module_count: usize, bundler: &dyn Bundler) -> TestApp {
.unwrap();

let npm = command("npm")
.args(["install", "--prefer-offline", "--loglevel=error"])
.args(["install", "--loglevel=error"])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

prefer-offline does not work reliably, it ends up causing resolving of dependencies to fail with an error saying that a package version does not exist that does exist on the npm registry.

.current_dir(test_app.path())
.output()
.unwrap();
Expand Down
Loading