Skip to content
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

thread safe memoization #11781

Merged
merged 17 commits into from
Sep 13, 2023
Merged

thread safe memoization #11781

merged 17 commits into from
Sep 13, 2023

Conversation

milaGGL
Copy link
Contributor

@milaGGL milaGGL commented Sep 6, 2023

#no-changelog

This pull request aims to address the data racing issue caused by memoized values, which is uncovered during the implementation of Multiple Inequality support.

@google-oss-bot
Copy link

google-oss-bot commented Sep 6, 2023

Coverage Report 1

Affected Products

  • FirebaseFirestore-iOS-FirebaseFirestore.framework

    Overall coverage changed from 88.14% (d732490) to 88.24% (ae4d534) by +0.09%.

    FilenameBase (d732490)Merge (ae4d534)Diff
    composite_filter.cc98.11%98.25%+0.13%
    exception.cc23.68%84.21%+60.53%
    field_filter.cc95.12%95.24%+0.12%
    filter.cc62.50%70.00%+7.50%
    leveldb_key.cc98.82%98.43%-0.39%
    leveldb_mutation_queue.cc92.42%93.56%+1.14%
    ordered_code.cc94.39%93.90%-0.49%
    query.cc98.51%98.68%+0.17%
    write_stream.cc94.37%91.55%-2.82%

Test Logs

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

@milaGGL milaGGL marked this pull request as ready for review September 6, 2023 18:11
@milaGGL milaGGL requested review from ehsannas and dconeybe September 6, 2023 18:11
@milaGGL milaGGL self-assigned this Sep 6, 2023
Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

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

Looks great overall! My comments are just suggesting more work for you ;)

Firestore/core/src/util/thread_safe_memoizer.h Outdated Show resolved Hide resolved
Firestore/core/src/core/composite_filter.cc Show resolved Hide resolved
@google-oss-bot
Copy link

google-oss-bot commented Sep 6, 2023

Size Report 1

Affected Products

  • FirebaseFirestore

    TypeBase (0e3f78b)Merge (a3862c3)Diff
    CocoaPods?-51.5 kB? (?)

Test Logs

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

@milaGGL milaGGL requested a review from dconeybe September 7, 2023 20:13
Firestore/core/src/core/query.h Outdated Show resolved Hide resolved
Firestore/core/src/core/query.h Outdated Show resolved Hide resolved
Firestore/core/src/core/query.cc Outdated Show resolved Hide resolved
Firestore/core/src/core/query.h Show resolved Hide resolved
Firestore/core/src/core/query.h Outdated Show resolved Hide resolved
Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

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

More thoughts

@milaGGL milaGGL requested a review from dconeybe September 11, 2023 18:53
Copy link
Contributor

@dconeybe dconeybe left a comment

Choose a reason for hiding this comment

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

Awesome work!

Firestore/core/src/core/filter.h Outdated Show resolved Hide resolved
Firestore/core/src/core/query.h Outdated Show resolved Hide resolved
@milaGGL milaGGL requested a review from dconeybe September 11, 2023 19:37
@milaGGL milaGGL requested a review from ehsannas September 11, 2023 19:47
Copy link
Contributor

@ehsannas ehsannas left a comment

Choose a reason for hiding this comment

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

LGTM. One suggestion regarding improving the test below.

@milaGGL milaGGL requested a review from ehsannas September 13, 2023 14:56
@milaGGL milaGGL merged commit afbfb27 into master Sep 13, 2023
41 checks passed
@milaGGL milaGGL deleted the mila/thread-safe-memoization branch September 13, 2023 16:24
andrewheard pushed a commit that referenced this pull request Sep 20, 2023
@firebase firebase locked and limited conversation to collaborators Oct 14, 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.

4 participants