Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

filter_events_for_client is time-consuming and expensive #14108

Closed
Tracked by #14284
MadLittleMods opened this issue Oct 7, 2022 · 3 comments · Fixed by #14527
Closed
Tracked by #14284

filter_events_for_client is time-consuming and expensive #14108

MadLittleMods opened this issue Oct 7, 2022 · 3 comments · Fixed by #14527
Assignees
Labels
A-Messages-Endpoint /messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill) S-Minor Blocks non-critical functionality, workarounds exist. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@MadLittleMods
Copy link
Contributor

filter_events_for_client is time-consuming and expensive.

From this /messages request (full trace), it takes 7.83s for 500 events and is one of the biggest time saves left after other /messages optimizations we've already made. Most of time is just spent in the database getting the state out.

/message trace in Jaeger show how slow `filter_events_for_client` is


Related to filter_events_for_server being expensive, #3526

@MadLittleMods MadLittleMods added the A-Messages-Endpoint /messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill) label Oct 7, 2022
@erikjohnston
Copy link
Member

Interesting. What sort of room is this? For large public rooms (and smaller rooms) it should be really quite fast

@erikjohnston erikjohnston added T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. S-Minor Blocks non-critical functionality, workarounds exist. labels Oct 11, 2022
@MadLittleMods
Copy link
Contributor Author

MadLittleMods commented Oct 11, 2022

@erikjohnston The beeg one #matrix:matrix.org (Matrix HQ) 🗿 (the 200k state events probably isn't helping)

@erikjohnston
Copy link
Member

Huh, but it should only be pulling out a couple of pieces of state (the history visibility mainly). Which should not take that long :/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Messages-Endpoint /messages client API endpoint (`RoomMessageListRestServlet`) (which also triggers /backfill) S-Minor Blocks non-critical functionality, workarounds exist. T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
2 participants