-
-
Notifications
You must be signed in to change notification settings - Fork 72
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
Question: did you benchmark it? #9
Comments
Hi, The latest benchmark result at the moment is here: #1 (comment)
Yeah, that's the point, because we don't know when render process ends. |
Ok thanks, guess we can close this then :) It seems useSelector is not that much faster and is quite a bit less ergonomic, what do you think? |
Theoretically, useSelector is faster than useTrackedState if a selector is properly implemented. The code in js-framework-benchmark is very simple and we don't see a big difference. You can see useSelector is faster in "select row." Here's another benchmark for reactive-react-redux, as a reference. In summary, useTrackedState is as fast as useSelector for most cases. In some cases, useTrackedState is slower. I don't have a benchmark, but if a developer wrote a selector improperly (which is likely), useSelector would be much slower. |
Forgot to respond this part:
Totally. It should be much more intuitive for most of the cases. |
Hello! the idea behind react-tracked seems interesting.
You claim the performances are better but did you actually verify that? Aren't you creating a completely new proxy on each update?
Cheers
The text was updated successfully, but these errors were encountered: