This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
get_bundled_aggregations
takes a few seconds even when there is no relations #13624
Copy link
Copy link
Closed
Labels
A-Messages-Endpoint/messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill)/messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill)A-PerformancePerformance, both client-facing and admin-facingPerformance, both client-facing and admin-facingA-ThreadsThreaded messagesThreaded messagesO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-MinorBlocks non-critical functionality, workarounds exist.Blocks non-critical functionality, workarounds exist.T-EnhancementNew features, changes in functionality, improvements in performance, or user-facing enhancements.New features, changes in functionality, improvements in performance, or user-facing enhancements.
Milestone
Description
Mentioned in internal doc about speeding up /messages
. Also see "2. Loading tons of events" in #13356
get_bundled_aggregations
takes a few seconds even when there is no relations. This happens at the end of every /messages
request.
For 500 messages that have 0 relations, reactions, threads, redactions, it takes 1 second to process. This is reproduced by running the many users, many messages Complement test I have in matrix-org/complement#443
Bunch of get_annotations_for_event
and get_relations_for_event
calls for each message:
Potential solutions
Batch up the lookups. It looks like most are just the magnitude of the round-trip to and from the database for each of the messages.
Metadata
Metadata
Assignees
Labels
A-Messages-Endpoint/messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill)/messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill)A-PerformancePerformance, both client-facing and admin-facingPerformance, both client-facing and admin-facingA-ThreadsThreaded messagesThreaded messagesO-OccasionalAffects or can be seen by some users regularly or most users rarelyAffects or can be seen by some users regularly or most users rarelyS-MinorBlocks non-critical functionality, workarounds exist.Blocks non-critical functionality, workarounds exist.T-EnhancementNew features, changes in functionality, improvements in performance, or user-facing enhancements.New features, changes in functionality, improvements in performance, or user-facing enhancements.