Skip to content

Conversation

@vicb
Copy link
Contributor

@vicb vicb commented Jun 27, 2025

Summary

fixes https://jira.cfdata.org/browse/DEVX-1983

Screenshots (optional)

Documentation checklist

@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2025

This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:

Pattern Owners
/src/content/changelog/ @cloudflare/pm-changelogs, @cloudflare/pcx-technical-writing

@vicb vicb requested a review from lrapoport-cf June 27, 2025 09:19
@github-actions
Copy link
Contributor

github-actions bot commented Jun 27, 2025

Copy link
Contributor

@irvinebroque irvinebroque left a comment

Choose a reason for hiding this comment

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

These are the internal details of what we did

But ultimately at the end of the day, what people care about is:

better performance via lower startup time for their worker

is there a before/after comparison we could do for a starter app?

i.e. - startup time before with OpenNext was X milliseconds, and now it is Y milliseconds?

@vicb
Copy link
Contributor Author

vicb commented Jul 10, 2025

@irvinebroque

These are the internal details of what we did [...]

What about changing

- We [removed `babel` from the app code](https://github.com/opennextjs/opennextjs-cloudflare/pull/710) to save ~4MB on a typical uncompressed app size
- We were also able [to drop a dependency on `@ampproject/toolbox-optimizer`](https://github.com/opennextjs/opennextjs-cloudflare/pull/700) to save ~3MB on a typical uncompressed app size
- We [stopped preloading all the app routes](https://github.com/opennextjs/opennextjs-cloudflare/pull/696) to save >100ms on the first request.

for:

The generated bundle size for a Next app created via create-next-app was decreased from 14 to 8MiB (2.3 to 1.6MiB gzipped).

The startup time for a medium-sized Next app would typically be 100ms faster.

Note that the startup time used to depend on the number of routes in the applications.
That's why I wrote "medium-sized" and "typically".
It's vague but I don't have a better idea.

Feel free to propose something now that you have the numbers.

Thanks!

@vicb vicb force-pushed the vicb/open-next-perf branch from 4b56e1f to da0567a Compare August 1, 2025 14:54
@vicb vicb requested a review from a team as a code owner August 1, 2025 14:54
@lrapoport-cf
Copy link
Contributor

@vicb one small note but otherwise lgtm :)

@vicb vicb enabled auto-merge (squash) August 1, 2025 18:51
@vicb vicb merged commit 9a7b846 into production Aug 1, 2025
8 checks passed
@vicb vicb deleted the vicb/open-next-perf branch August 1, 2025 18:54
thomasgauvin pushed a commit that referenced this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants