mirror of
https://github.com/element-hq/synapse.git
synced 2026-11-04 11:17:51 +00:00
The write transaction read six times between its writes, each read a round trip: the room's depth, which events it already had, their redactions, whether the prev events were persisted, the cache prefill's rejections and redactions, and a cache stream ID. Now the rooms row of a new room and the depth update are queued writes (the depth update conditional, as Python's read made it), the three reads it still needs go out together with eight cache stream IDs in one round trip behind them, through the new WriteTxn::query_many, and the rest is known: the cache prefill from the contexts and the redactions already read, and a prev event the chunk itself persists needs no check. A chunk that creates a room is written in two round trips instead of eight. The createRoom bench gets a sane event cache, as the test default of one entry made every read after persisting a fetch, which no server does.