Skip to content

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

Merged
milaGGL merged 14 commits into
mainfrom
mila/fix-utf8-encoded-string-comparison
Mar 3, 2025
Merged

milaGGL merged 14 commits into
mainfrom
mila/fix-utf8-encoded-string-comparison

Conversation

@milaGGL

@milaGGL milaGGL commented Feb 18, 2025 •

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Feb 18, 2025 •

Copy link
Copy Markdown
Contributor

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

google-oss-bot commented Feb 18, 2025 •

Copy link
Copy Markdown
Collaborator

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

@github-actions

github-actions Bot commented Feb 18, 2025 •

Copy link
Copy Markdown
Contributor

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

google-oss-bot commented Feb 18, 2025 •

Copy link
Copy Markdown
Collaborator

Size Report 1

Affected Products

  • firebase-firestore

    TypeBase (ad7618b)Merge (3aaa074)Diff
    aar1.45 MB1.45 MB+315 B (+0.0%)
    apk (release)11.4 MB11.4 MB+252 B (+0.0%)

Test Logs

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

@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
Comment thread firebase-firestore/src/main/java/com/google/firebase/firestore/util/Util.java Outdated
@milaGGL
milaGGL requested a review from ehsannas February 20, 2025 21:27
@milaGGL
milaGGL merged commit ec26a52 into main Mar 3, 2025
@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