Signal-iOS/SignalServiceKit/tests
george-signal ec66f3b21e
Break envelope processing into two parts (#4340)
The purpose of this change is to alleviate the
main source of CPU-grinding after sending a
message to a large group: about 20% of the total
time is spent decoding and re-encoding messages as
they are fetched from the DB and then updated with
info about which recipients have acknowledged
delivery.

Prior to this commit, we decrypted the payload and
then processed the message in a single rather deep
call tree that began in `processNextBatch`. There
are two completely different paths through this
tree that lead to handling a delivery receipt
because server-generated delivery receipts have
the necessary info in plaintext in the envelope
and client-generated delivery receipts have it in
the ciphertext.

The idea here is to break incoming envelope
handling into two parts.

In the first part, each envelope is decrypted and
other common activities (like handling sender key
distribution messages) are performed. A processing
request is created for each. Next, processing
requests are handled. It's easy to examine a
processing request to determine if it is a
delivery receipt, and if so, for what outgoing
message. Doing so allows the new
DeliveryReceiptContext class to cache message
fetches and combine updates to the same message.

Processing requests are grouped together so that
sequential delivery receipt requests enjoy caching
of messages and coalescing of updates into a
single fetch/decode/encode/commit. Other kinds of
envelopes are handled immediately to avoid
increasing memory pressure that caching multiple
messages could cause.
2022-06-09 16:40:34 -07:00
..
Account Move pre-key culling logic from TSPreKeyManager to the stores 2022-04-07 10:23:39 -07:00
Contacts Add message to all XCTFails 2022-05-04 09:54:46 -05:00
Devices Update to LibSignalClient v0.15.0 2022-03-24 11:55:45 -07:00
Groups Rework the 'pending member requests and invites' view. 2020-09-03 18:33:07 -03:00
Messages Break envelope processing into two parts (#4340) 2022-06-09 16:40:34 -07:00
Network Add first gift badge screen 2022-05-19 14:07:23 +00:00
Security Apply script to normalize includes and imports. 2021-10-21 09:21:10 -03:00
Storage Make "Keep Muted Chats Archived" option available publicly 2022-05-26 10:44:43 -04:00
Util Show "0:00", not "0", for audio message playback 2022-05-06 11:43:04 -07:00
SSKBaseTestObjC.h Respond to CR. 2021-10-21 09:21:31 -03:00
SSKBaseTestObjC.m Apply script to normalize includes and imports. 2021-10-21 09:21:10 -03:00
SSKBaseTestSwift.swift Test phone number sharing modes for sealed sender 2022-05-18 10:21:53 -07:00
SSKSwiftTests.swift Convert to just using CocoaPods for dependencies 2020-01-02 12:03:57 -08:00