Skip to content

Conversation

alexkirsz
Copy link
Contributor

Description

This improves the reliability of HMR benchmarks for bundlers that can drop updates (Vite, Turbopack). Before, an update being dropped meant the whole benchmark was canceled.

Testing Instructions

Running the benchmarks

@alexkirsz alexkirsz requested a review from a team as a code owner April 25, 2023 11:25
@vercel
Copy link
Contributor

vercel bot commented Apr 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
examples-cra-web 🔄 Building (Inspect) May 1, 2023 3:47pm
examples-svelte-web 🔄 Building (Inspect) May 1, 2023 3:47pm
turbo-site 🔄 Building (Inspect) Visit Preview May 1, 2023 3:47pm
8 Ignored Deployments
Name Status Preview Comments Updated (UTC)
examples-basic-web ⬜️ Ignored (Inspect) May 1, 2023 3:47pm
examples-designsystem-docs ⬜️ Ignored (Inspect) May 1, 2023 3:47pm
examples-gatsby-web ⬜️ Ignored (Inspect) May 1, 2023 3:47pm
examples-kitchensink-blog ⬜️ Ignored (Inspect) May 1, 2023 3:47pm
examples-native-web ⬜️ Ignored (Inspect) May 1, 2023 3:47pm
examples-nonmonorepo ⬜️ Ignored (Inspect) May 1, 2023 3:47pm
examples-tailwind-web ⬜️ Ignored (Inspect) May 1, 2023 3:47pm
examples-vite-web ⬜️ Ignored (Inspect) May 1, 2023 3:47pm

@github-actions
Copy link
Contributor

✅ This change can build next-swc

@github-actions
Copy link
Contributor

github-actions bot commented Apr 25, 2023

🟢 CI successful 🟢

Thanks

Comment on lines 39 to 43
/// The maximum amount of time to wait for HMR during the actual benchmark. This
/// is a lot shorter than the init timeout because we expect updates to
/// generally happen quickly, and we don't want to wait for a long time when an
/// update is dropped.
const MAX_UPDATE_TIMEOUT: Duration = Duration::from_secs(5);
Copy link
Member

@sokra sokra Apr 25, 2023

Choose a reason for hiding this comment

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

Isn't that a bit too short for 30k modules with e. g. webpack?

Maybe we can scale the number by number of modules?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed, I forgot just how slow these were. The issue with having too high a number here is that it considerably slows down benchmarks when updates are, in fact, dropped. Perhaps this timeout should be variable, or exponential.

@alexkirsz alexkirsz force-pushed the alexkirsz/benchmark-dropped-updates branch from dbba87d to 67d9209 Compare May 1, 2023 13:00
@alexkirsz alexkirsz added the pr: automerge Kodiak will merge these automatically after checks pass label May 1, 2023
@kodiakhq kodiakhq bot merged commit e7cce86 into main May 1, 2023
@kodiakhq kodiakhq bot deleted the alexkirsz/benchmark-dropped-updates branch May 1, 2023 16:18
kodiakhq bot pushed a commit to vercel/next.js that referenced this pull request May 2, 2023
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 25, 2024
### Description

This improves the reliability of HMR benchmarks for bundlers that can
drop updates (Vite, Turbopack). Before, an update being dropped meant
the whole benchmark was canceled.

### Testing Instructions

Running the benchmarks
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Jul 29, 2024
### Description

This improves the reliability of HMR benchmarks for bundlers that can
drop updates (Vite, Turbopack). Before, an update being dropped meant
the whole benchmark was canceled.

### Testing Instructions

Running the benchmarks
ForsakenHarmony pushed a commit to vercel/next.js that referenced this pull request Aug 1, 2024
### Description

This improves the reliability of HMR benchmarks for bundlers that can
drop updates (Vite, Turbopack). Before, an update being dropped meant
the whole benchmark was canceled.

### Testing Instructions

Running the benchmarks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: automerge Kodiak will merge these automatically after checks pass
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants