-
Notifications
You must be signed in to change notification settings - Fork 617
Performance: Don't deserialize full document Proto for Query execution #561
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
Changes from 6 commits
48dcf7e
8d31c26
9f3e2e7
c76f65a
d60bb85
4f793f0
f559f72
a7de38f
22b2c25
f50e19a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,12 +45,13 @@ public void testEquals() { | |
assertNotEquals(base, differentData); | ||
assertNotEquals(base, fromCache); | ||
|
||
// Note: `base` and `differentData` have the same hash code since we no longer take document | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can't be right. We can't just ignore
However if we have a non- What do you think of implementing both equality and hashCode according to the principle above? I think that would give most (if not all) the benefit without compromising the contract of equals/hashCode. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hrm. This is a good comment, and I 100% agree with you, but I don't think I broke the contract here in the way that you stated. I removed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ha! Sorry about misreading that. I didn't realize that this was about an expected collision. An alternative phrasing that might be less confusing is:
You might also want to call attention to this in an implementation comment in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea about the additional comment. I added it to |
||
// contents into account. | ||
assertEquals(base.hashCode(), baseDup.hashCode()); | ||
assertEquals(noData.hashCode(), noDataDup.hashCode()); | ||
assertNotEquals(base.hashCode(), noData.hashCode()); | ||
assertNotEquals(noData.hashCode(), base.hashCode()); | ||
assertNotEquals(base.hashCode(), differentPath.hashCode()); | ||
assertNotEquals(base.hashCode(), differentData.hashCode()); | ||
assertNotEquals(base.hashCode(), fromCache.hashCode()); | ||
} | ||
} |
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.
@Nullable
, right? (in the case of the second constructor it stays null initially).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.
Yep. Done.