-
Notifications
You must be signed in to change notification settings - Fork 84
implement example apps benchmarking #117
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
Conversation
|
commit: |
be387fa to
557ddba
Compare
vicb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this.
I added a few comments.
Co-authored-by: Victor Berchet <[email protected]>
c35adea to
f54f54f
Compare
vicb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the updates
As discussed with the team we want to look into application performance improvements, but before doing that it's important to know where we start, so we can also validate our solutions and see if we are actually improving things.
So for this I'm introducing here some rudimental benchmarking capabilities that rely on our
examples.The
benchmarkscript I'm adding here allows any user (including external contributors) to log in using wrangler, deploy and benchmark the example applications.The benchmarking here simply consists in
fetching from the deployed application and seeing how long the fetch took (usingperformance.now()calls).This is the result of running the script (

pnpm benchmarkat the root of the monorepo):`2024-11-01_16-41-33.json.json`
[ { "name": "api", "path": "/Users/dario/Repos/opennextjs-cloudflare/examples/api", "fetchBenchmark": { "calls": [ 968.4477079999997, 92.53629199999705, 91.15600000000268, 64.40050000000338, 81.6182919999992, 99.98604200000409, 107.83137500000157, 158.28583299999445, 713.4847079999963, 116.06433400000242, 85.19845799999894, 126.78262499999983, 68.33308300000499, 98.43016600000556, 82.63295899999503, 158.11979200000496, 365.22762499999953, 100.05025000000023, 101.95495800000208, 81.64195800000016 ], "average": 188.1091479000006 } }, { "name": "create-next-app", "path": "/Users/dario/Repos/opennextjs-cloudflare/examples/create-next-app", "fetchBenchmark": { "calls": [ 120.17570799999521, 83.23262500000419, 77.19024999999965, 76.00137499999983, 114.57091599999694, 72.455458000004, 84.43537500000093, 64.03845900000306, 63.78299999999581, 101.29545900000085, 139.92129199999908, 69.30854199999885, 1025.9113339999967, 327.7433749999982, 71.47758299999987, 96.38175000000047, 68.3715000000011, 87.0643329999948, 159.8877500000017, 104.00108299999556 ], "average": 150.36235834999934 } }, { "name": "vercel-blog-starter", "path": "/Users/dario/Repos/opennextjs-cloudflare/examples/vercel-blog-starter", "fetchBenchmark": { "calls": [ 162.13308400000096, 218.4584579999937, 711.0034999999989, 149.95554099999572, 165.5824999999968, 162.60087499999645, 218.49045800000022, 204.74100000000908, 1105.5174999999945, 204.81149999999616, 170.08466699999553, 148.48545800000284, 160.25333300000057, 147.34891600000265, 169.2338329999984, 234.29762499999924, 156.23070900000312, 139.84700000000157, 153.2925000000032, 645.9700840000005 ], "average": 271.4169270499995 } } ]Things can be improved later on and we can also generalize the script here (I tried making it fairly generic/reusable), but as a starting point I think this should (hopefully) be pretty adequate 🙂