Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
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

@MadLittleMods

Description

@MadLittleMods

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:
Jaeger trace of get_bundled_aggregations that contains a bunch of get_annotations_for_event and get_relations_for_event

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)A-PerformancePerformance, both client-facing and admin-facingA-ThreadsThreaded messagesO-OccasionalAffects or can be seen by some users regularly or most users rarelyS-MinorBlocks non-critical functionality, workarounds exist.T-EnhancementNew features, changes in functionality, improvements in performance, or user-facing enhancements.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions