-
Notifications
You must be signed in to change notification settings - Fork 949
firestore: misc.ts: re-implemented compareUtf8Strings() to be even more simple and efficient #9143
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: da7185b The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Size Report 1Affected Products
Test Logs |
Size Analysis Report 1This report is too large (864,920 characters) to be displayed here in a GitHub comment. Please use the below link to see the full report on Google Cloud Storage.Test Logs |
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.
Thank you for the fix.
? primitiveComparator(leftChar, rightChar) | ||
: isSurrogate(leftChar) | ||
? 1 | ||
: -1; |
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.
Ultranit: I'd group the last expression in brackets, (isSurrogate(leftChar) ? 1 : -1)
.
Re-implemented Firestore's
compareUtf8Strings()
function based on the greatly-improved algorithm from firebase/firebase-android-sdk#7098.This algorithm has gone through a lot of churn recently due to performance issues with the naive implementation. This is (hopefully) the last PR to touch this function due to performance issues. The PR's leading up to this one are: