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

WIP: Sameness #1410

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft

WIP: Sameness #1410

wants to merge 7 commits into from

Conversation

hhugo
Copy link
Member

@hhugo hhugo commented Feb 18, 2023

Fix #1372

@hhugo
Copy link
Member Author

hhugo commented Feb 20, 2023

This change revealed some issues with some js stubs what were returning -0 instead of 0.

@hhugo
Copy link
Member Author

hhugo commented Feb 22, 2023

@ty, is there any per difference between the two ? Is object.is available everywhere?

@TyOverby
Copy link
Collaborator

https://caniuse.com/mdn-javascript_builtins_object_is

It’s pretty widely supported!

@TyOverby
Copy link
Collaborator

As for performance impacts, I don't have a good intuition for if it would be faster or slower. A small microbenchmark that I just made seems to indicate that Object.is is faster

image

@hhugo
Copy link
Member Author

hhugo commented Feb 28, 2023

some other seems to show that === is faster (when inputs are ints and array, which should be the common case).

@hhugo hhugo force-pushed the sameness branch 2 times, most recently from eb52732 to dc2ff61 Compare February 28, 2023 15:23
@hhugo
Copy link
Member Author

hhugo commented Feb 28, 2023

I'm not really happy with the current implementation, mostly because the decision to use === or Object.is is syntactic.
@vouillon, any opinion ?

@hhugo hhugo marked this pull request as draft December 2, 2023 07:33
@hhugo hhugo changed the title Sameness WIP: Sameness Dec 2, 2023
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.

Use Object.is instead of === to implement phys_equal
2 participants