Skip to content

Use lazy encoding in utf-8 encoded string comparison #6706

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

Merged
merged 14 commits into from
Mar 3, 2025

Conversation

milaGGL
Copy link
Contributor

@milaGGL milaGGL commented Feb 18, 2025

The previous fix created a performance issue due to expensive UTF-8 encoding. Update compareUtf8Strings to use lazy encoding instead.

Copy link
Contributor

github-actions bot commented Feb 18, 2025

Release note changes

The following release notes were modified. Please ensure they look correct.

Release Notes
firebase-firestore
### {{firestore}} version 25.1.3 {: #firestore_v25-1-3}

* {{fixed}} Use lazy encoding in UTF-8 encoded byte comparison for strings to solve performance issues. GitHub [#6706](//github.com/firebase/firebase-android-sdk/issues/6706){: .external}

* {{changed}} Updated `protolite-well-known-types` dependency to `18.0.1`. GitHub [#6716](//github.com/firebase/firebase-android-sdk/issues/6716){: .external}

#### {{firestore}} Kotlin extensions version 25.1.3 {: #firestore-ktx_v25-1-3}

The Kotlin extensions library transitively includes the updated
`firebase-firestore` library. The Kotlin extensions library has no additional
updates.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 18, 2025

Coverage Report 1

Affected Products

  • firebase-firestore

    Overall coverage changed from 45.74% (ad7618b) to 45.76% (3aaa074) by +0.01%.

    FilenameBase (ad7618b)Merge (3aaa074)Diff
    DeleteMutation.java95.24%90.48%-4.76%
    LruGarbageCollector.java97.27%93.64%-3.64%
    SetMutation.java94.44%97.22%+2.78%
    Util.java73.94%75.80%+1.85%

Test Logs

  1. https://storage.googleapis.com/firebase-sdk-metric-reports/UyNhEzhE2m.html

Copy link
Contributor

github-actions bot commented Feb 18, 2025

Test Results

  186 files   -   848    186 suites   - 848   4m 42s ⏱️ - 29m 31s
1 235 tests  - 4 656  1 219 ✅  - 4 650  16 💤  -  6  0 ❌ ±0 
2 494 runs   - 9 351  2 462 ✅  - 9 339  32 💤  - 12  0 ❌ ±0 

Results for commit 629b394. ± Comparison against base commit ad7618b.

This pull request removes 4657 and adds 1 tests. Note that renamed tests count towards both.
com.google.android.datatransport.cct.CctBackendFactoryTest ‑ create_returnCCTBackend_WhenBackendNameIsCCT
com.google.android.datatransport.cct.CctDestinationTest ‑ cctDestination_shouldOnlySupportProtoAndJson
com.google.android.datatransport.cct.CctDestinationTest ‑ cctDestination_shouldSupportProtoAndJson
com.google.android.datatransport.cct.CctTransportBackendTest ‑ decorate_whenOffline_shouldProperlyPopulateNetworkInfo
com.google.android.datatransport.cct.CctTransportBackendTest ‑ decorate_whenOnline_shouldProperlyPopulateNetworkInfo
com.google.android.datatransport.cct.CctTransportBackendTest ‑ schedule_shouldAddCookieOnPseudonymousIds
com.google.android.datatransport.cct.CctTransportBackendTest ‑ schedule_shouldDropCookieOnMixedPseudonymousIds
com.google.android.datatransport.cct.CctTransportBackendTest ‑ send_CompressedResponseIsUncompressed
com.google.android.datatransport.cct.CctTransportBackendTest ‑ send_whenBackendRedirectsMoreThan5Times_shouldOnlyRedirect4Times
com.google.android.datatransport.cct.CctTransportBackendTest ‑ send_whenBackendRedirects_shouldCorrectlyFollowTheRedirectViaPost
…
com.google.firebase.firestore.util.UtilTest ‑ compareUtf8StringsShouldReturnCorrectValue

♻️ This comment has been updated with latest results.

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Feb 18, 2025

@milaGGL milaGGL marked this pull request as ready for review February 19, 2025 15:14
@milaGGL milaGGL requested a review from ehsannas February 19, 2025 15:15
@milaGGL milaGGL requested a review from ehsannas February 20, 2025 21:27
@milaGGL milaGGL merged commit ec26a52 into main Mar 3, 2025
33 checks passed
@milaGGL milaGGL deleted the mila/fix-utf8-encoded-string-comparison branch March 3, 2025 16:38
@firebase firebase locked and limited conversation to collaborators Apr 3, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants