the-draupnir-project / Draupnir

A Matrix moderation bot
https://the-draupnir-project.github.io/draupnir-documentation/
70 stars 14 forks source link

Investigate startup time regression #380

Closed Gnuxie closed 2 months ago

Gnuxie commented 2 months ago

At startup we changed the code in MPS to load rooms from the backing store all at once rather than one by one

https://github.com/Gnuxie/matrix-protection-suite/blob/6ae7c8ce8226cb18eea941345d9907d62aa75b5d/src/Protection/ProtectedRoomsManager/StandardProtectedRoomsManager.ts#L103

https://github.com/Gnuxie/matrix-protection-suite/blob/c3e574a1f7740e5c8057fbf43e9c98d9bd32e640/src/StateTracking/StandardSetRoomState.ts#L50-L52

-- or so i thought, but they should in effect be exactly the same? Either way on breadpirates.chat i noticed startup going from a 10seconds to ~1minute after this change, which is about as long as it takes without the backing store... so not sure what is going on.

The difference between main and v2.0.0-beta.2 looks like this: image

I suspect that the loading code is a red herring, and in reality the changes are due to changes to typebox and the schema in the same release of MPS

Gnuxie commented 2 months ago

Ok workaround didn't work.

Gnuxie commented 2 months ago

https://github.com/sinclairzx81/typebox/issues/825#issuecomment-2094776148

Gnuxie commented 2 months ago

image