-
Notifications
You must be signed in to change notification settings - Fork 20
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
Use object.is for equality check #30
Comments
It would be but I'm not aware of the performance difference. If there's any benchmarks that we can look at that would help. |
It is not about performance but reliability. Object.is returns true for Since there is no implicit type conversion, it should be faster than |
Performance is extremely important for our signals implementation, especially as the reacitvity graph becomes more deep. We have thousands of computations in our libraries that use this. Most rely on signals purely for performance. The trade off for checking something super rare like |
I could not find any definitive benchmark results that runs extensive checks. I did run some using mitata, performance difference is marginal, which favors either of them depending on the compared values and the runtime. |
Not a major issue but i think
Object.is
would be better for cheking signal updates:signals/src/core.ts
Line 398 in 65f7fe9
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness
The text was updated successfully, but these errors were encountered: