After this PR is merged, the Objective-C serializers can be completely removed from the project. Also, this PR changes the `Message` class quite a bit; it's probably in its final form now.
I did some performance testing locally and came to the conclusion that replacing Objective-C serializers with their C++ versions brings no performance downgrade; actually, there seems to be a very slight improvement. I tested writing large batches and reading large collections:
* both are network-dominated; wall time is about twice longer than CPU time;
* serialization represents a pretty small percentage of the total CPU time;
* for writing, C++ serialization is a little more efficient, taking ~6% of total CPU time, compared to ~8% in the Objective-C version. I've seen similar results for reading.
All integration tests pass, under Address Sanitizer as well.
* Port FSTMemoryPersistence to C++ (#3754)
* Add local::Persistence
* Add MemoryPersistence
* Add MemoryEagerReferenceDelegate
* Make LruDelegate extend ReferenceDelegate
This enables downcasting to LruDelegate in tests that need to do so.
* Add MemoryLruReferenceDelegate
* Don't double-count document key size.
* Port FSTLevelDB to C++ (#3755)
* Add LevelDbPersistence
Note that Apple-specific initialization has been partitioned off in
anticipation of being able to run this code on non-Apple platforms.
* Add LevelDbLruReferenceDelegate
* Migrate to C++ Persistence (1/2) (#3756)
* Use C++ Persistence classes in FSTLocalStore
* Remove ReferenceDelegateBridge
* Cut src over to C++ persistence types
* Remove Objective-C requirement from some classes
... that no longer require it.
* Migrate to C++ Persistence (2/2) (#3757)
* Remove LruDelegateBridge
* Update test initialization of persistence components
In particular, ensure that there's always an owner for the Persistence
instance, which wasn't always handled explicitly in the Objective-C
version of the tests.
* Largely mechanical changes to tests
* Remove Objective-C persistence classes
* Forward declare util::Status when possible (#3761)
* Add a header dedicated to forward declarations for util::Status
* Use status_fwd.h wherever possible
* Fix leveldb benchmarks
... which apparently haven't been built in a while
* Manage configuration for Benchmarks and FuzzTests
* Suppress warnings in LibFuzzer
* Add a Firestore_Benchmarks_iOS scheme
* xcodeproj: Remove manual configuration for Fuzzer and Benchmarks
* Update LibFuzzer build for recent clangs
Builds are currently failing with this on standard out:
-fsanitize-coverage=trace-pc-guard is no longer supported by
libFuzzer. Please either migrate to a compiler that supports
-fsanitize=fuzzer or use an older version of libFuzzer
* Rewrite lint.sh as check_lint.py
This makes several beneficial changes:
* Runs in parallel: lint all now takes 5.5 seconds, down from 25.
* Supports linting specific files, passed on the command-line.
* Defaults to linting files changed since master, pass --all to lint
everything.
* Infers header language based on related files.
* Lays the groundwork for linting more than just C++.
* Adds support for linting python.
* Fix lint errors
* Use check_lint.py in check.sh
* Remove lint.sh
* Python lint configuration
* Enable python linting in travis
* Remove stale references to DatabaseId
* Have Firestore take the DatabaseId directly
* Allow tests to default the database implicitly
* Have FSTSerializerBeta take DatabaseId by value
* Have FSTUserDataConverter take DatabaseId by value
* Make FIRFirestore.databaseID a const reference
* Make FSTFirestoreClient.databaseID a const reference
* Have FSTReferenceValue take DatabaseId by value
* Have DatabaseInfo take DatabaseId by value
* Have Serializer take DatabaseId by value
* Fix C++ ReferenceValue
* Take DatabaseId by value
* Reverse order to match Android
* Rename `reference` to `key`
Also eliminate most usages of `FSTDocumentKey`, remove most methods from the Objective-C class and make it just a wrapper over `DocumentKey`. The only usage that cannot be directly replaced by C++ `DocumentKey` is in `FSTFieldValue`.
* Migrate to LevelDbVersionKey
* Migrate to LevelDbMutationKey
* Migrate to LevelDbDocumentMutationKey
* Migrate to LevelDbMutationQueueKey
* Migrate to LevelDbTargetGlobalKey
* Migrate to LevelDbTargetKey
* Migrate to LevelDbQueryTargetKey
* Migrate to LevelDbTargetDocumentKey
* Migrate to LevelDbDocumentTargetKey
* Migrate to LevelDbRemoteDocumentKey
Also:
- Remove FSTLevelDBKey and tests
- Remove StringView and tests
* Step one of benchmarking
* Benchmark writing to leveldb
* Comment out and style
* More comments
* Fix warnings
* Someday I will lint as good as computer
* Some light commenting and static-ing
* It seems to be working?
* Remove unused test file
* Drop commented-out deps
* Revert string quoting in pbxproj file
* Drop reference to deleted file
* Move podspec, fix import
* Lots of C++ style changes
* Style
* Drop whitespace