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

Add MFNG (minimal RSC library) benchmark #5

Merged
merged 4 commits into from
Apr 11, 2024
Merged

Conversation

unstubbable
Copy link
Contributor

@unstubbable unstubbable commented Apr 11, 2024

It seems that the main reason Next.js isn't performing well is due to RSC itself, rather than the app router overhead.

Screenshot 2024-04-11 at 13 48 49

MFNG is a minimal React Server Components bundler & library

@eknkc eknkc merged commit 25c06f0 into eknkc:master Apr 11, 2024
@unstubbable unstubbable deleted the mfng branch April 11, 2024 14:46
@eknkc
Copy link
Owner

eknkc commented Apr 11, 2024

I had to change import.meta.dirname to process.cwd() cause it was undefined for my node version. Maybe it is introduced pretty recently. Anyway.

I also added a duplication factor metric which measures how many times each uuid is observed in the response however it shows 2.5 for mfng which does not really make sense. My calculation code might be wrong.

@unstubbable
Copy link
Contributor Author

import.meta.dirname was added with v20.11.0.

On my machine, it also shows 2.0 for MFNG:

(index) name ops/sec average (ms) samples body (kb) duplication relative to react
0 'react' 857 '1.166' 12862 '97.28' 'x1.00'
1 'sveltekit' 675 '1.479' 10140 '184.46' 'x2.00' '1.27 x slower'
2 'solid' 640 '1.561' 9607 '215.93' 'x2.00' '1.34 x slower'
3 'remix' 530 '1.884' 7963 '189.10' 'x2.00' '1.62 x slower'
4 'vue' 349 '2.858' 5249 '96.72' 'x1.00' '2.46 x slower'
5 'nuxt' 334 '2.993' 5012 '97.57' 'x1.00' '2.57 x slower'
6 'mfng' 68 '14.543' 1032 '282.15' 'x2.00' '12.60 x slower'
7 'next' 60 '16.609' 904 '284.64' 'x2.00' '14.28 x slower'

@unstubbable
Copy link
Contributor Author

unstubbable commented Apr 11, 2024

Ah, I still had a handler in dist that was built on my branch. On master with a fresh build, I also get 2.5. I'll have look into why...

@unstubbable
Copy link
Contributor Author

unstubbable commented Apr 11, 2024

Got it, one of the two UUIDs is also used as key for the table row. In the MFNG benchmark, a newer canary version of React is used that includes facebook/react#28123. The Next.js benchmark on the other hand, uses an older canary version where the keys are null in the serialized RSC chunks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants