Skip to content

firestore::local::LevelDbDocumentOverlayCache added. #9345

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 10 commits into from
Feb 22, 2022

Conversation

dconeybe
Copy link
Contributor

@dconeybe dconeybe commented Feb 14, 2022

Create LevelDbDocumentOverlayCache, the analogue of SqliteDocumentOverlayCache.java from the Android SDK. The unit tests for LevelDbDocumentOverlayCache re-use the ones forMemoryDocumentOverlayCache (added in #9330), since those tests were written in a manner that enables them to be parameterized.

Future PRs will be needed to improve the performance of this new class. The performance of GetOverlay() is O(log(n)), which is acceptable; however, the performance of RemoveOverlaysForBatchId(), GetOverlays(const ResourcePath&, int), and GetOverlays(const std::string&, int, std::size_t) are θ(n), where n is the number of overlays in the database for the user, which is unacceptable. Using manual indexing, their performances can be improved to O(m(log(m)) for RemoveOverlaysForBatchId() and O(m) for the two GetOverlays() methods, where m is the number of overlays that are affected/returned by the methods.

Googlers see b/210002758 for details.

#no-changelog

@dconeybe dconeybe self-assigned this Feb 14, 2022
@google-oss-bot
Copy link

google-oss-bot commented Feb 14, 2022

@google-oss-bot
Copy link

google-oss-bot commented Feb 14, 2022

Coverage Report 1

Affected Products

  • FirebaseFirestore-iOS-FirebaseFirestore.framework

    Overall coverage changed from 86.01% (47c046e) to 86.19% (9a212bb) by +0.19%.

    FilenameBase (47c046e)Merge (9a212bb)Diff
    exception.cc73.68%23.68%-50.00%
    exception_apple.mm58.62%89.66%+31.03%
    leveldb_document_overlay_cache.cc0.00%97.01%+97.01%
    leveldb_key.cc97.80%98.14%+0.35%
    leveldb_persistence.cc86.08%88.75%+2.67%
    local_serializer.cc83.19%83.52%+0.33%
    ordered_code.cc94.15%93.41%-0.73%
    set_mutation.cc89.36%95.74%+6.38%
    task.cc93.04%94.78%+1.74%

Test Logs

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

Copy link
Contributor

@wu-hui wu-hui left a comment

Choose a reason for hiding this comment

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

Thanks for deleting the proto!

I left some comments, around a method you are about to rewrite..for feel free to ignore.

@wu-hui wu-hui removed their assignment Feb 18, 2022
@wu-hui
Copy link
Contributor

wu-hui commented Feb 22, 2022

LGTM

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