Refactor embed module so all channel related sends are async #21

Open
opened 2024-07-14 09:36:53 +00:00 by froge · 0 comments
Owner

During testing it appears that the majority of latency incurred by the embeds module when sending URL preview responses is actually being caused by a blocking call to room.send() inside the matrix-sdk API, this call sometimes takes a long time to complete (over 2 seconds in many cases) and it appears to be the largest bottleneck in improving performance and responsiveness for this code.

We should refactor the embed module so all async requests are awaited concurrently, including room.send(), so they won't block the hot-loop code used to send through URL embeds in response to user's messages. This should significantly improve performance (especially around latency with multiple links).

During testing it appears that the majority of latency incurred by the embeds module when sending URL preview responses is actually being caused by a blocking call to `room.send()` inside the matrix-sdk API, this call sometimes takes a long time to complete (over 2 seconds in many cases) and it appears to be the largest bottleneck in improving performance and responsiveness for this code. We should refactor the embed module so all async requests are awaited concurrently, including `room.send()`, so they won't block the hot-loop code used to send through URL embeds in response to user's messages. This should significantly improve performance (especially around latency with multiple links).
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: krabopolis/frogbot#21
No description provided.