element-hq / element-hq/synapse

`_auth_and_persist_outliers` could do with being optimised

Open
#11,013 0 comments 0 reactions 0 assignees View on GitHub
A-Performance T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#11013](https://github.com/matrix-org/synapse/issues/11013).

---

As part of my work on #9595, I've ended up making some of the code which persists events received over federation a bit more conservative. (Specifically, this is the code for handling batches of outliers, in `FederationEventHandler._auth_and_persist_outliers`).

https://github.com/matrix-org/synapse/pull/10896#discussion_r715475624 raised the concern that this could result in a lot of round-trips between the federation inbound worker and the event persister.

It should be possible to optimise all this, so that we do all the event auth first, and *then* persist everything in one big chunk.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.