Optimize Pdu prev_events and auth_events containers.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-09-23 18:12:06 +00:00
parent 887a22dabd
commit aa37e32471
11 changed files with 62 additions and 50 deletions

View File

@@ -195,6 +195,7 @@ async fn send_state_event_for_key_helper(
room_id,
&state_lock,
)
.boxed()
.await?;
Ok(event_id)

View File

@@ -533,9 +533,9 @@ async fn handle_left_room(
unsigned: None,
// The following keys are dropped on conversion
room_id: room_id.clone(),
prev_events: vec![],
prev_events: Default::default(),
auth_events: Default::default(),
depth: uint!(1),
auth_events: vec![],
redacts: None,
hashes: EventHash::default(),
signatures: None,

View File

@@ -161,12 +161,10 @@ async fn handle(
})
.try_flatten()
.try_collect()
.boxed()
.await?;
// evaluate edus after pdus, at least for now.
edus.for_each_concurrent(automatic_width(), |edu| handle_edu(services, client, origin, edu))
.boxed()
.await;
Ok(results)
@@ -205,6 +203,7 @@ async fn handle_room(
Ok((event_id, result))
})
.try_collect()
.boxed()
.await
}