-
Notifications
You must be signed in to change notification settings - Fork 10.5k
compare Set and Dictionary by address for equality #400
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
compare Set and Dictionary by address for equality #400
Conversation
// FIXME(performance): early exit if lhs and rhs reference the same | ||
// storage? | ||
|
||
if unsafeAddressOf(lhsNativeOwner) == unsafeAddressOf(rhsNativeOwner) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that's right, this code would compare addresses of the let
bindings.
Does ===
work?
@dduan Can you take a look at |
Hi, @gribozavr, both are covered in debug build. cc @nadavrot |
@gribozavr Switched to |
as noted in the comment, the native storage version of Set and Dictionary can be considered equal if their Owner object have the same address. This should speed up == by quite a bit in those cases. use === for equality of HashedCollection owner
cfeab2b
to
9c28ff0
Compare
@gribozavr @dduan No concerns. Thanks for doing the work. |
@gribozavr @nadavrot squashed. Thank you :) |
compare Set and Dictionary by address for equality
queue: clean up a covered switch
[perf_test] Update performance `smoke test` project configurations
as noted in the comment, the native storage version of Set and Dictionary can
be considered equal if their Owner object have the same address. This should
speed up == by quite a bit in those cases.