matrix-org
matrix-rust-sdk
BlogDocsChangelog

fix(sqlite): Empty the cache after the introduction of `TimelineEvent::timestamp`

#5665Merged
Comparing
Hywan:fix-sqlite-empty-event-cache-because-of-timelineevent-timestamp
(
6f34829
) with
main
(
c2bc465
)
CodSpeed Performance Gauge
0%
Untouched
49

Benchmarks

Passed

Create a timeline with initial events[10000 events]
benchmarks/benches/timeline.rs::room::create_timeline_with_initial_events::Create a timeline
CodSpeed Performance Gauge
+2%
749.7 ms732.2 ms
Linked chunk metadata loader[memory store][1000]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
+2%
758.9 µs742.2 µs
Event cache find_event_relations[SQLite][10 events, #no filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
+2%
1.2 ms1.2 ms
Event cache room updates[memory][room count: 1]
benchmarks/benches/event_cache.rs::event_cache::handle_room_updates::Event cache room updates
CodSpeed Performance Gauge
+1%
14.5 ms14.3 ms
Linked chunk lazy loader[memory store][1000]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
+1%
2.5 ms2.5 ms
Linked chunk lazy loader[memory store][10]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
+1%
34.9 µs34.6 µs
Event cache find_event_relations[SQLite][100 events, #no filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
+1%
8.1 ms8.1 ms
Linked chunk metadata loader[memory store][100]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
+1%
21.1 µs20.9 µs
Linked chunk writing [memory store][10]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
53 µs52.7 µs
Device keys query [SQLite][153 device and cross signing keys]
benchmarks/benches/crypto_bench.rs::benches::keys_query::Keys querying
CodSpeed Performance Gauge
0%
40.1 ms39.9 ms
Event cache find_event_relations[SQLite][1000 events, edits filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
83.2 ms83 ms
Event cache room updates[SQLite][room count: 100]
benchmarks/benches/event_cache.rs::event_cache::handle_room_updates::Event cache room updates
CodSpeed Performance Gauge
0%
4.2 s4.2 s
Linked chunk writing [none][10]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
16 µs15.9 µs
Event cache find_event_relations[SQLite][100 events, edits filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
8.6 ms8.6 ms
Devices collecting [SQLite][2003 devices]
benchmarks/benches/crypto_bench.rs::benches::devices_missing_sessions_collecting::Devices missing sessions collecting
CodSpeed Performance Gauge
0%
114 ms113.8 ms
Room key sharing [SQLite][163 devices]
benchmarks/benches/crypto_bench.rs::benches::room_key_sharing::Room key sharing
CodSpeed Performance Gauge
0%
57.9 ms57.8 ms
Linked chunk lazy loader[sqlite store][1000]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
0%
15.6 ms15.5 ms
Restore session [SQLite][clear]
benchmarks/benches/store_bench.rs::benches::restore_session::Client reload
CodSpeed Performance Gauge
0%
754.3 ms753.7 ms
Event cache find_event_relations[SQLite][10 events, edits filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms
Room key sharing [memory][163 devices]
benchmarks/benches/crypto_bench.rs::benches::room_key_sharing::Room key sharing
CodSpeed Performance Gauge
0%
46.7 ms46.7 ms
Linked chunk metadata loader[sqlite store][10]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
0%
174.2 µs174 µs
Event cache room updates[memory][room count: 10]
benchmarks/benches/event_cache.rs::event_cache::handle_room_updates::Event cache room updates
CodSpeed Performance Gauge
0%
145.1 ms145 ms
Linked chunk writing [sqlite store][1000]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
27.7 ms27.7 ms
Device keys query [memory][153 device and cross signing keys]
benchmarks/benches/crypto_bench.rs::benches::keys_query::Keys querying
CodSpeed Performance Gauge
0%
27.6 ms27.6 ms
Event cache find_event_relations[memory][10 events, edits filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
3.3 ms3.3 ms
Linked chunk writing [sqlite store][100]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
2.6 ms2.6 ms
Event cache find_event_relations[memory][10 events, #no filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
3.3 ms3.3 ms
Event cache find_event_relations[memory][1000 events, #no filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
2.2 s2.2 s
Linked chunk metadata loader[sqlite store][1000]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
0%
1.2 ms1.2 ms
Event cache find_event_relations[memory][1000 events, edits filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
2.2 s2.2 s
Linked chunk writing [none][1000]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
832.3 µs832.3 µs
Event cache find_event_relations[memory][100 events, edits filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
46.8 ms46.8 ms
Event cache find_event_relations[memory][100 events, #no filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
0%
46.8 ms46.8 ms
Restore session [memory store]
benchmarks/benches/store_bench.rs::benches::restore_session::Client reload
CodSpeed Performance Gauge
0%
273.5 ms273.6 ms
Event cache room updates[memory][room count: 100]
benchmarks/benches/event_cache.rs::event_cache::handle_room_updates::Event cache room updates
CodSpeed Performance Gauge
0%
1.5 s1.5 s
Event cache room updates[SQLite][room count: 10]
benchmarks/benches/event_cache.rs::event_cache::handle_room_updates::Event cache room updates
CodSpeed Performance Gauge
0%
396.1 ms396.6 ms
Restore session [SQLite][encrypted]
benchmarks/benches/store_bench.rs::benches::restore_session::Client reload
CodSpeed Performance Gauge
0%
1.4 s1.4 s
Linked chunk writing [none][100]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
88.6 µs88.7 µs
Devices collecting [memory][2003 devices]
benchmarks/benches/crypto_bench.rs::benches::devices_missing_sessions_collecting::Devices missing sessions collecting
CodSpeed Performance Gauge
0%
10.7 ms10.7 ms
Linked chunk writing [memory store][100]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
358.7 µs359.5 µs
Event cache room updates[SQLite][room count: 1]
benchmarks/benches/event_cache.rs::event_cache::handle_room_updates::Event cache room updates
CodSpeed Performance Gauge
0%
37.4 ms37.6 ms
Linked chunk metadata loader[sqlite store][100]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
0%
244.1 µs245.1 µs
Linked chunk lazy loader[memory store][100]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
0%
195.7 µs196.6 µs
Linked chunk writing [sqlite store][10]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
0%
550.9 µs553.4 µs
Linked chunk lazy loader[sqlite store][10]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
-1%
431.5 µs433.8 µs
Linked chunk lazy loader[sqlite store][100]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
-1%
1.7 ms1.8 ms
Event cache find_event_relations[SQLite][1000 events, #no filter]
benchmarks/benches/event_cache.rs::event_cache::find_event_relations::Event cache room updates
CodSpeed Performance Gauge
-1%
78.3 ms79.1 ms
Linked chunk metadata loader[memory store][10]
benchmarks/benches/linked_chunk.rs::event_cache::reading::Linked chunk reading
CodSpeed Performance Gauge
-1%
6 µs6 µs
Linked chunk writing [memory store][1000]
benchmarks/benches/linked_chunk.rs::event_cache::writing::Linked chunk writing
CodSpeed Performance Gauge
-2%
3.6 ms3.7 ms

Commits

Click on a commit to change the comparison range
Base
main
c2bc465
+0.12%
fix(sqlite): Empty the cache after the introduction of `TimelineEvent::timestamp`. After the merge of https://github.com/matrix-org/matrix-rust-sdk/pull/5648, we want all events to get a `TimelineEvent::timestamp` value (extracted from `origin_server_ts`). To accomplish that, we are emptying the event cache. New synced events will be built correctly, with a valid `TimelineEvent::timestamp`, allowing a clear, stable situation.
6f34829
3 months ago
by Hywan
© 2025 CodSpeed Technology
Home Terms Privacy Docs