Skip to content

[wip] Add an e2e test page for testing the swr performance when many hooks are used. #4137

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

Closed
wants to merge 3 commits into from

Conversation

gdborton
Copy link
Member

@gdborton gdborton commented Jun 25, 2025

I'm trying to showcase a performance issue in SWR. The code as is adds a test page that has two render paths, one renders 10k divs directly, the other renders 10k divs using the same swr hook.

The render path that uses swr is extremely slow to paint.

TODO:

  • create the test page
  • Add a test that ensures lots of hooks isn't orders of magnitude slower than no hooks
  • Fix the failing test.

How to see this manually.

clone git@github.com:vercel/swr.git;
cd swr/e2e/site/app/perf;
npm install;
npm run dev

^ load https://localhost:3000/perf

Video:

slow-swr.mp4

Copy link

codesandbox-ci bot commented Jun 25, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@gdborton
Copy link
Member Author

gdborton commented Jul 2, 2025

This was fixed here:
#4138

@gdborton gdborton closed this Jul 2, 2025
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.

1 participant