Skip to content

Conversation

@jmartinesp
Copy link
Contributor

Added methods to perform cleanup/maintenance/optimization actions in the stores, so we can manually trigger them from the clients. This is a first attempt to understand if running these optimizations fixes an observed issue in the clients where the DB performance degrades severely as the cache grows.

cc @Hywan

  • Public API changes documented in changelogs (optional)

Signed-off-by:

This method should trigger any optimization/maintenance behaviours available to the stores, like `VACUUM` in SQLite
@jmartinesp jmartinesp requested a review from a team as a code owner November 28, 2025 12:26
@jmartinesp jmartinesp requested review from poljar and removed request for a team November 28, 2025 12:26
@jmartinesp jmartinesp force-pushed the misc/add-client-optimize-stores-method branch from a40c0e6 to 44514c3 Compare November 28, 2025 12:32
@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 0% with 38 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.62%. Comparing base (73449f4) to head (2cbb357).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
crates/matrix-sdk/src/client/mod.rs 0.00% 9 Missing ⚠️
crates/matrix-sdk-sqlite/src/event_cache_store.rs 0.00% 5 Missing ⚠️
crates/matrix-sdk-sqlite/src/media_store.rs 0.00% 5 Missing ⚠️
crates/matrix-sdk-sqlite/src/state_store.rs 0.00% 5 Missing ⚠️
...rix-sdk-base/src/event_cache/store/memory_store.rs 0.00% 2 Missing ⚠️
...es/matrix-sdk-base/src/event_cache/store/traits.rs 0.00% 2 Missing ⚠️
...es/matrix-sdk-base/src/media/store/memory_store.rs 0.00% 2 Missing ⚠️
crates/matrix-sdk-base/src/media/store/traits.rs 0.00% 2 Missing ⚠️
crates/matrix-sdk-base/src/store/memory_store.rs 0.00% 2 Missing ⚠️
crates/matrix-sdk-base/src/store/traits.rs 0.00% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5911      +/-   ##
==========================================
- Coverage   88.66%   88.62%   -0.04%     
==========================================
  Files         362      362              
  Lines      104399   104437      +38     
  Branches   104399   104437      +38     
==========================================
- Hits        92569    92561       -8     
- Misses       7499     7545      +46     
  Partials     4331     4331              

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

…raits

Only SQLite based stores will implement it for now, calling the `SqliteAsyncConnExt::vacuum` method
…uccessfully

This was a bit confusing, because I treated a lack of logs as success when in reality my code was calling an empty implementation
@codspeed-hq
Copy link

codspeed-hq bot commented Nov 28, 2025

CodSpeed Performance Report

Merging #5911 will not alter performance

Comparing misc/add-client-optimize-stores-method (2cbb357) with main (73449f4)

Summary

✅ 50 untouched

@jmartinesp jmartinesp force-pushed the misc/add-client-optimize-stores-method branch from 44514c3 to 20f1921 Compare November 28, 2025 12:51
@jmartinesp jmartinesp marked this pull request as draft November 28, 2025 14:37
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