Skip to content

fix(sdk): Disable OrderTracker for the moment #5407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Hywan
Copy link
Member

@Hywan Hywan commented Jul 15, 2025

This patch removes the use of OrderTracker because the implementation of EventCacheStore::load_all_chunks_metadata for SqliteEventCacheStore is the cause of severe slowness (up to 100s for some accounts). It's been introduced in #5225.

We are going to undo this patch once the problem has been solved.
Edit:

Metrics

Using this rageshake, the logs introduced in this PR, and this command-line to only list executions of load_all_chunks_metadata taking more than one second:

$ rg '_method_ finished in.*> load_all_chunks_metadata' foo.log | rg '\d+(\.\d+)?s' --only-matching | sort --numeric-sort --reverse
107.121747125s
79.909931458s
10.348993583s
8.827636417s
8.614481625s
8.009787875s
5.99637875s
4.118492334s
3.910040333s
3.718858334s
3.689340667s
3.661383208s
2.310609666s
2.221779s
2.087249333s
1.898318333s
1.320944334s
1.005408875s

@Hywan Hywan requested a review from a team as a code owner July 15, 2025 09:20
@Hywan Hywan requested review from poljar and removed request for a team July 15, 2025 09:20
This patch removes the use of `OrderTracker` because the
implementation of `EventCacheStore::load_all_chunks_metadata` for
`SqliteEventCacheStore` is the cause of severe slownesses (up to 100s
for some account).

We are going to undo this patch once the problem has been solved.
@Hywan Hywan force-pushed the fix-sdk-event-cache-turn-off-order-tracker branch from 1a8862e to 6bbea2c Compare July 15, 2025 09:22
Copy link

codecov bot commented Jul 15, 2025

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 88.84%. Comparing base (7d9d5bf) to head (6bbea2c).
Report is 5 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/event_cache/room/mod.rs 80.00% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5407      +/-   ##
==========================================
+ Coverage   88.80%   88.84%   +0.03%     
==========================================
  Files         334      334              
  Lines       91256    91015     -241     
  Branches    91256    91015     -241     
==========================================
- Hits        81044    80862     -182     
+ Misses       6399     6340      -59     
  Partials     3813     3813              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@poljar poljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright, let's see if this is actually the culprit.

@Hywan Hywan merged commit c5f2460 into matrix-org:main Jul 15, 2025
44 checks passed
@Hywan
Copy link
Member Author

Hywan commented Jul 15, 2025

For the record, perf is no longer a problem. It confirms this is the culprit. Now let's fix that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants