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.
have_seen_events
is eating up time while processing state and auth events while backfilling #13625
Copy link
Copy link
Open
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-facingO-UncommonMost users are unlikely to come across this or unexpected workflowMost users are unlikely to come across this or unexpected workflowS-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. Part of #13356
Optimize have_seen_events
because when backfilling #matrix:matrix.org
, 20s is just calling have_seen_events
on the 200k state and auth events in the room.
have_seen_events
(157db.have_seen_events
) takes 6.62s to process 77k eventshave_seen_events
(246db.have_seen_events
) takes 13.19s to process 122k events
Benchmark and timing is from the in-flight PR, #13561
The @cachedList
is so slow 🐌 and we're better off removing it at this point. Would be good see if @cachedList
can be improved or if we can improve things further with a better cache.
# events | Timing | Timing (removing the @cachedList cache) |
---|---|---|
50k | . Benchmark time (1 cold cache ): 3.7170820236206055 |
. Benchmark time (1 cold cache ): 0.3248419761657715 |
100k | . Benchmark time (1 cold cache ): 8.10055136680603 |
. Benchmark time (1 cold cache ): 0.8466510772705078 |
200k | . Benchmark time (1 cold cache ): 19.106724977493286 |
. Benchmark time (1 cold cache ): 1.328582763671875 |
3nprob
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-facingO-UncommonMost users are unlikely to come across this or unexpected workflowMost users are unlikely to come across this or unexpected workflowS-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.