Improve sync performance with more caching and wrapping things in Arcs to avoid copies

This commit is contained in:
Timo Kösters committed 2023-06-27 13:15:11 +02:00
1 parent 7c6d25dcd1
commit be877ef719
12 files changed
+112 -98

No files matched your search

+11 -9
View File
@@ -743,15 +743,17 @@ async fn join_room_by_id_helper(
info!("Saving state from send_join");
let (statehash_before_join, new, removed) = services().rooms.state_compressor.save_state(
room_id,
state
.into_iter()
.map(|(k, id)| {
services()
.rooms
.state_compressor
.compress_state_event(k, &id)
})
.collect::<Result<_>>()?,
Arc::new(
state
.into_iter()
.map(|(k, id)| {
services()
.rooms
.state_compressor
.compress_state_event(k, &id)
})
.collect::<Result<_>>()?,
),
)?;
services()