mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-12-10 17:31:26 -05:00
Reduce event lookups during room creation by passing known event IDs (#13210)
Inspired by the room batch handler, this uses previous event inserts to pre-populate prev events during room creation, reducing the number of queries required to create a room. Signed off by Nick @ Beeper (@Fizzadar)
This commit is contained in:
parent
11f811470f
commit
92202ce867
3 changed files with 32 additions and 2 deletions
|
|
@ -708,6 +708,21 @@ class RoomsCreateTestCase(RoomBase):
|
|||
|
||||
self.assertEqual(200, channel.code, channel.result)
|
||||
self.assertTrue("room_id" in channel.json_body)
|
||||
assert channel.resource_usage is not None
|
||||
self.assertEqual(33, channel.resource_usage.db_txn_count)
|
||||
|
||||
def test_post_room_initial_state(self) -> None:
|
||||
# POST with initial_state config key, expect new room id
|
||||
channel = self.make_request(
|
||||
"POST",
|
||||
"/createRoom",
|
||||
b'{"initial_state":[{"type": "m.bridge", "content": {}}]}',
|
||||
)
|
||||
|
||||
self.assertEqual(200, channel.code, channel.result)
|
||||
self.assertTrue("room_id" in channel.json_body)
|
||||
assert channel.resource_usage is not None
|
||||
self.assertEqual(37, channel.resource_usage.db_txn_count)
|
||||
|
||||
def test_post_room_visibility_key(self) -> None:
|
||||
# POST with visibility config key, expect new room id
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue