Page MenuHomePhabricator

[lib] improve `processOutboundP2PMessages` in terms of performance
ClosedPublic

Authored by kamil on Aug 28 2024, 10:22 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 6, 11:03 PM
Unknown Object (File)
Oct 6 2024, 9:03 PM
Unknown Object (File)
Oct 6 2024, 9:03 PM
Unknown Object (File)
Oct 6 2024, 9:03 PM
Unknown Object (File)
Oct 6 2024, 9:02 PM
Unknown Object (File)
Oct 6 2024, 7:43 PM
Unknown Object (File)
Oct 1 2024, 3:40 AM
Unknown Object (File)
Oct 1 2024, 3:40 AM
Subscribers

Details

Summary

ENG-9096

We need to do it per device, not per message to avoid creating multiple sessions in parallel.

Test Plan

Test DM ops (text messages, settings, reactions, etc.)

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kamil held this revision as a draft.
kamil published this revision for review.Aug 28 2024, 10:22 AM
kamil edited the summary of this revision. (Show Details)
tomek added inline comments.
lib/tunnelbroker/peer-to-peer-context.js
131–133 ↗(On Diff #43775)

It might look a little better as a map instead of a for.

This revision is now accepted and ready to land.Aug 28 2024, 10:26 AM
lib/tunnelbroker/peer-to-peer-context.js
134

Why do we still go through each message one-by-one, instead of in parallel?

lib/tunnelbroker/peer-to-peer-context.js
134

Discussed this with @kamil in our 1:1 today. The reason for this is that if we're sending multiple messages to the same device, we would end up initiating the session multiple times, which would be very bad as we'd override the session.

We'll track improving this in ENG-9106