If there are several group changes being returned at once, deserializing all of them up front can lead to excessive memory use, especially for very large groups. This commit switches to deserializing each change as it is used, which doubles the amount of CPU work (because we loop through the changes twice) in exchange for only ever having one Change object graph in memory at a time. It does also mean we can get a protobuf deserialization error a bit later in the process if the data is ever corrupted, but that shouldn't cause additional issues at these particular call sites. |
||
|---|---|---|
| .. | ||
| DeviceTransfer.proto | ||
| Fingerprint.proto | ||
| Groups.proto | ||
| KeyBackup.proto | ||
| Makefile | ||
| Provisioning.proto | ||
| README.md | ||
| SessionRecord.proto | ||
| SignalIOS.proto | ||
| SignalService.proto | ||
| StorageService.proto | ||
| WebSocketResources.proto | ||
SignalServiceKit Protobufs
These protobuf definitions are copied from Signal-Android, but modified to match some iOS conventions.
Prequisites
Install Apple's swift-protobuf (not the similarly named protobuf-swift)
brew install swift-protobuf
This should install an up to date protobuf package as a dependency. Note that since we use the legacy proto2 format, we need to specify this in our .proto files.
syntax = "proto2";
Building Protobuf
cd ~/src/WhisperSystems/SignalServiceKit/protobuf
make