Skip to content

Firestore: remove unused compareTo() computation #5132

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 1 commit into from
Jul 5, 2023

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Jul 4, 2023

Remove a useless invocation of compareTo() whose result was being ignored. It appears that this useless compareTo() call was accidentally left behind from some previous refactor. Comparing it to the JS and iOS implementations, https://github.com/firebase/firebase-js-sdk/blob/aea4a4471306b089a02b207d2df285dfc71666c7/packages/firestore/src/core/view.ts#L295-L300 and https://github.com/firebase/firebase-ios-sdk/blob/876b9624e490cfc9451250d1a02eb959f6746927/Firestore/core/src/core/view.cc#L266-L275, respectively, it appears that the desired logic omits this useless compareTo() call.

This "bug" was detected by static analysis of https://errorprone.info/bugpattern/CheckReturnValue in google3 (Googlers see cl/544688630 and cl/544704978).

Remove a useless invocation of compareTo() whose result was being ignored. It appears that this useless compareTo() call was accidentally left behind from some previous refactor. Comparing it to the JS and iOS implementations, https://github.com/firebase/firebase-js-sdk/blob/aea4a4471306b089a02b207d2df285dfc71666c7/packages/firestore/src/core/view.ts#L295-L300 and https://github.com/firebase/firebase-ios-sdk/blob/876b9624e490cfc9451250d1a02eb959f6746927/Firestore/core/src/core/view.cc#L266-L275, respectively, it appears that the desired logic omits this useless compareTo() call.
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2023

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

1 similar comment
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2023

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

@google-oss-bot
Copy link
Contributor

Coverage Report 1

Affected Products

  • firebase-firestore

    Overall coverage changed from 44.35% (52389ce) to 44.33% (a39dd75) by -0.01%.

    FilenameBase (52389ce)Merge (a39dd75)Diff
    DeleteMutation.java90.48%95.24%+4.76%
    LruGarbageCollector.java97.27%93.64%-3.64%
    View.java96.82%96.79%-0.02%

Test Logs

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

@dconeybe dconeybe enabled auto-merge (squash) July 4, 2023 19:07
@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2023

Unit Test Results

   162 files  +   134     162 suites  +134   1m 53s ⏱️ +5s
1 164 tests +   885  1 148 ✔️ +   869  16 💤 +16  0 ±0 
2 328 runs  +1 770  2 296 ✔️ +1 738  32 💤 +32  0 ±0 

Results for commit 4a7e101. ± Comparison against base commit 52389ce.

This pull request removes 279 and adds 1164 tests. Note that renamed tests count towards both.
com.google.firebase.remoteconfig.FirebaseRemoteConfigSettingsTest ‑ toBuilder_withFieldsSet_buildsObjectWithFieldsSet
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate2p_hasAbtExperiments_doesNotCallAbt
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate2p_hasNoAbtExperiments_doesNotCallAbt
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate_callToAbtFails_activateStillSucceeds
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate_fileWriteFails_doesNotClearFetchedAndReturnsFalse
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate_fireperfNamespace_freshFetchedConfigs_activatesAndClearsFetched
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate_fireperfNamespace_noFetchedConfigs_returnsFalse
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate_freshFetchedConfigs_activatesAndClearsFetched
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate_getActivatedFailed_activatesAndClearsFetched
com.google.firebase.remoteconfig.FirebaseRemoteConfigTest ‑ activate_getFetchedFailed_returnsFalse
…
com.google.firebase.TimestampTest ‑ testCompare
com.google.firebase.TimestampTest ‑ testFromDate
com.google.firebase.TimestampTest ‑ testRejectBadDates
com.google.firebase.TimestampTest ‑ testTimestampParcelable
com.google.firebase.firestore.AggregateQuerySnapshotTest ‑ createWithCountShouldReturnInstanceWithTheGivenQueryAndCount
com.google.firebase.firestore.AggregateQueryTest ‑ testSourceMustNotBeNull
com.google.firebase.firestore.BlobTest ‑ testComparison
com.google.firebase.firestore.BlobTest ‑ testEquals
com.google.firebase.firestore.BlobTest ‑ testMutableBytes
com.google.firebase.firestore.CollectionReferenceTest ‑ testEquals
…

@google-oss-bot
Copy link
Contributor

Size Report 1

Affected Products

  • firebase-firestore

    TypeBase (52389ce)Merge (a39dd75)Diff
    aar1.36 MB1.36 MB-31 B (-0.0%)
    apk (release)3.95 MB3.95 MB+20 B (+0.0%)

Test Logs

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

@google-oss-bot
Copy link
Contributor

Startup Time Report 1

Note: Layout is sometimes suboptimal due to limited formatting support on GitHub. Please check this report on GCS.

Notes

Startup Times

  • fire-fst

    DeviceStatisticsDistributions
    oriole-32
    Percentile52389cea39dd75DiffSignificant (?)
    p10325 ±22 μs315 ±15 μs-10.0 μs (-3.1%)NO
    p25340 ±27 μs330 ±21 μs-10.1 μs (-3.0%)NO
    p50384 ±55 μs355 ±33 μs-28.8 μs (-7.5%)NO
    p75434 ±89 μs438 ±102 μs+3.81 μs (+0.9%)NO
    p90506 ±114 μs535 ±160 μs+29.6 μs (+5.9%)NO

    20 test runs in comparison
    CommitTest Runs
    52389ce
    • 2023-06-30_20:14:35.185343_CAsS
    • 2023-06-30_20:14:35.189592_Siju
    • 2023-06-30_20:14:35.189615_fIps
    • 2023-06-30_20:14:35.189625_dyfD
    • 2023-06-30_20:14:35.189639_KhaW
    • 2023-06-30_20:14:35.189648_MRFZ
    • 2023-06-30_20:14:35.189655_wLHM
    • 2023-06-30_20:14:35.189662_hjaB
    • 2023-06-30_20:14:35.189668_DLWx
    • 2023-06-30_20:14:35.189675_DEwy
    a39dd75
    • 2023-07-04_19:15:32.758376_XjSW
    • 2023-07-04_19:15:32.760812_deBz
    • 2023-07-04_19:15:32.760824_MIYl
    • 2023-07-04_19:15:32.760832_PhuV
    • 2023-07-04_19:15:32.760838_OQvk
    • 2023-07-04_19:15:32.760843_jfGb
    • 2023-07-04_19:15:32.760849_dSUa
    • 2023-07-04_19:15:32.760854_RKqJ
    • 2023-07-04_19:15:32.760863_BocM
    • 2023-07-04_19:15:32.760868_QuaU
    redfin-30
    Percentile52389cea39dd75DiffSignificant (?)
    p10598 ±24 μs606 ±28 μs+7.78 μs (+1.3%)NO
    p25614 ±26 μs622 ±34 μs+7.60 μs (+1.2%)NO
    p50639 ±29 μs648 ±40 μs+9.53 μs (+1.5%)NO
    p75672 ±34 μs689 ±61 μs+16.6 μs (+2.5%)NO
    p90722 ±42 μs748 ±107 μs+26.1 μs (+3.6%)NO

    20 test runs in comparison
    CommitTest Runs
    52389ce
    • 2023-06-30_20:14:35.185343_CAsS
    • 2023-06-30_20:14:35.189592_Siju
    • 2023-06-30_20:14:35.189615_fIps
    • 2023-06-30_20:14:35.189625_dyfD
    • 2023-06-30_20:14:35.189639_KhaW
    • 2023-06-30_20:14:35.189648_MRFZ
    • 2023-06-30_20:14:35.189655_wLHM
    • 2023-06-30_20:14:35.189662_hjaB
    • 2023-06-30_20:14:35.189668_DLWx
    • 2023-06-30_20:14:35.189675_DEwy
    a39dd75
    • 2023-07-04_19:15:32.758376_XjSW
    • 2023-07-04_19:15:32.760812_deBz
    • 2023-07-04_19:15:32.760824_MIYl
    • 2023-07-04_19:15:32.760832_PhuV
    • 2023-07-04_19:15:32.760838_OQvk
    • 2023-07-04_19:15:32.760843_jfGb
    • 2023-07-04_19:15:32.760849_dSUa
    • 2023-07-04_19:15:32.760854_RKqJ
    • 2023-07-04_19:15:32.760863_BocM
    • 2023-07-04_19:15:32.760868_QuaU
  • timeToInitialDisplay

    DeviceStatisticsDistributions
    oriole-32
    Percentile52389cea39dd75DiffSignificant (?)
    p10203 ±5 ms203 ±3 ms-34.5 μs (-0.0%)NO
    p25208 ±5 ms209 ±3 ms+969 μs (+0.5%)NO
    p50215 ±5 ms217 ±3 ms+1.93 ms (+0.9%)NO
    p75223 ±5 ms227 ±3 ms+3.71 ms (+1.7%)NO
    p90231 ±5 ms238 ±5 ms+7.54 ms (+3.3%)NO

    20 test runs in comparison
    CommitTest Runs
    52389ce
    • 2023-06-30_20:14:35.185343_CAsS
    • 2023-06-30_20:14:35.189592_Siju
    • 2023-06-30_20:14:35.189615_fIps
    • 2023-06-30_20:14:35.189625_dyfD
    • 2023-06-30_20:14:35.189639_KhaW
    • 2023-06-30_20:14:35.189648_MRFZ
    • 2023-06-30_20:14:35.189655_wLHM
    • 2023-06-30_20:14:35.189662_hjaB
    • 2023-06-30_20:14:35.189668_DLWx
    • 2023-06-30_20:14:35.189675_DEwy
    a39dd75
    • 2023-07-04_19:15:32.758376_XjSW
    • 2023-07-04_19:15:32.760812_deBz
    • 2023-07-04_19:15:32.760824_MIYl
    • 2023-07-04_19:15:32.760832_PhuV
    • 2023-07-04_19:15:32.760838_OQvk
    • 2023-07-04_19:15:32.760843_jfGb
    • 2023-07-04_19:15:32.760849_dSUa
    • 2023-07-04_19:15:32.760854_RKqJ
    • 2023-07-04_19:15:32.760863_BocM
    • 2023-07-04_19:15:32.760868_QuaU
    redfin-30
    Percentile52389cea39dd75DiffSignificant (?)
    p10244 ±4 ms266 ±5 ms+22.9 ms (+9.4%)YES
    p25251 ±4 ms273 ±5 ms+22.1 ms (+8.8%)YES
    p50258 ±5 ms280 ±6 ms+22.6 ms (+8.8%)MAYBE
    p75267 ±5 ms291 ±5 ms+24.3 ms (+9.1%)YES
    p90276 ±5 ms306 ±11 ms+30.4 ms (+11.0%)MAYBE

    20 test runs in comparison
    CommitTest Runs
    52389ce
    • 2023-06-30_20:14:35.185343_CAsS
    • 2023-06-30_20:14:35.189592_Siju
    • 2023-06-30_20:14:35.189615_fIps
    • 2023-06-30_20:14:35.189625_dyfD
    • 2023-06-30_20:14:35.189639_KhaW
    • 2023-06-30_20:14:35.189648_MRFZ
    • 2023-06-30_20:14:35.189655_wLHM
    • 2023-06-30_20:14:35.189662_hjaB
    • 2023-06-30_20:14:35.189668_DLWx
    • 2023-06-30_20:14:35.189675_DEwy
    a39dd75
    • 2023-07-04_19:15:32.758376_XjSW
    • 2023-07-04_19:15:32.760812_deBz
    • 2023-07-04_19:15:32.760824_MIYl
    • 2023-07-04_19:15:32.760832_PhuV
    • 2023-07-04_19:15:32.760838_OQvk
    • 2023-07-04_19:15:32.760843_jfGb
    • 2023-07-04_19:15:32.760849_dSUa
    • 2023-07-04_19:15:32.760854_RKqJ
    • 2023-07-04_19:15:32.760863_BocM
    • 2023-07-04_19:15:32.760868_QuaU

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

@dconeybe dconeybe changed the title Firestore: removed unused compareTo() computation Firestore: remove unused compareTo() computation Jul 5, 2023
Copy link
Contributor

@cherylEnkidu cherylEnkidu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dconeybe dconeybe merged commit 1e44257 into master Jul 5, 2023
@dconeybe dconeybe deleted the dconeybe/ViewUselessCompareToRemoved branch July 5, 2023 16:26
@firebase firebase locked and limited conversation to collaborators Aug 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants