Skip to content
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

Investigate parallelizing cipher.decrypt calls when decoding regular/presence/state messages #1906

Open
VeskeR opened this issue Oct 24, 2024 · 2 comments
Labels
enhancement New feature or improved functionality.

Comments

@VeskeR
Copy link
Contributor

VeskeR commented Oct 24, 2024

See discussion in PR comments.

When decoding regular/presence (and state in future) messages we end up calling cipher.decrypt, which based on our current documentation only supports AES algorithm in CBC mode. Presumably, decryption for AES in CBC mode can be parallelized, so we may be able to improve those decoding calls using await Promise.all instead of doing them sequantially.

┆Issue is synchronized with this Jira Task by Unito

@VeskeR VeskeR added the enhancement New feature or improved functionality. label Oct 24, 2024
@VeskeR VeskeR changed the title Investigate parallelizing of cipher.decrypt calls when decoding regular/presence/state messages Investigate parallelizing cipher.decrypt calls when decoding regular/presence/state messages Oct 24, 2024
@VeskeR
Copy link
Contributor Author

VeskeR commented Oct 25, 2024

ok, upon further investigation it seems that even though cipher.decrypt might not be a problem here, the vcdiff decoding depends on the previous recevied payload in enable to be able to decode the next one (see code), so the intended way to use decode function is to call it sequentially for each received message data and wait for a result.

I think we're not going to parallelize the decode calls, but it is a good idea to add corresponding comments in the code explaining that decode is intended to be called sequentially

@VeskeR
Copy link
Contributor Author

VeskeR commented Oct 25, 2024

@owenpearson ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

1 participant