-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
remove a bunch of act calls in useSuspenseQuery test #11918
base: main
Are you sure you want to change the base?
Conversation
|
size-limit report 📦
|
✅ Deploy Preview for apollo-client-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
With this PR: % hyperfine --runs 5 -- 'yarn test useSuspenseQuery --selectProjects "ReactDOM 18" --silent'
Benchmark 1: yarn test useSuspenseQuery --selectProjects "ReactDOM 18" --silent
Time (mean ± σ): 10.244 s ± 1.850 s [User: 6.877 s, System: 0.606 s]
Range (min … max): 9.359 s … 13.551 s 5 runs
% hyperfine --runs 5 -- 'yarn test useSuspenseQuery --selectProjects "ReactDOM 19" --silent'
Benchmark 1: yarn test useSuspenseQuery --selectProjects "ReactDOM 19" --silent
Time (mean ± σ): 68.795 s ± 1.287 s [User: 9.550 s, System: 0.811 s]
Range (min … max): 68.105 s … 71.078 s 5 runs On % hyperfine --runs 5 -- 'yarn test useSuspenseQuery --selectProjects "ReactDOM 18" --silent' main
Benchmark 1: yarn test useSuspenseQuery --selectProjects "ReactDOM 18" --silent
Time (mean ± σ): 9.385 s ± 0.907 s [User: 6.011 s, System: 0.599 s]
Range (min … max): 8.907 s … 11.004 s 5 runs
% hyperfine --runs 5 -- 'yarn test useSuspenseQuery --selectProjects "ReactDOM 19" --silent' main
Benchmark 1: yarn test useSuspenseQuery --selectProjects "ReactDOM 19" --silent
Time (mean ± σ): 77.302 s ± 1.008 s [User: 14.714 s, System: 1.897 s]
Range (min … max): 76.564 s … 78.775 s 5 runs So, this shaves off about 10s, but does not make the big difference. |
I did some further investigation, and there are a few test impacted by this. I have very small sample sizes, so some of these numbers might be hiccups. Tests that significantly changed from bad change to good change (positive numbers bad, negative numbers good)
The last one got so much better because it no longer triggers the React bug(?) we reported here: So while this PR gives some improvements overall, tests just got a lot slower, even with these changes. How much worse did it get?
|
Since this test suite is extremely slow in React 19, I want to try if removing
act
where possible speeds it up in any way.