From 49fd7a6e9c38c1efae4ef00193c949310feb4fd3 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 16 Nov 2022 11:11:50 +0000 Subject: [PATCH 1/2] Don't filter state in /context response We don't filter state usually, so doing so here is a waste of time. --- synapse/handlers/room.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synapse/handlers/room.py b/synapse/handlers/room.py index 66a50bca6eb6..6dcfd86fdf36 100644 --- a/synapse/handlers/room.py +++ b/synapse/handlers/room.py @@ -1451,7 +1451,7 @@ async def filter_evts(events: List[EventBase]) -> List[EventBase]: events_before=events_before, event=event, events_after=events_after, - state=await filter_evts(state_events), + state=state_events, aggregations=aggregations, start=await token.copy_and_replace( StreamKeyType.ROOM, results.start From 97a33cd17da37fe158bf50d6c3225a50db17feeb Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Wed, 16 Nov 2022 11:16:09 +0000 Subject: [PATCH 2/2] Newsfile --- changelog.d/14461.misc | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/14461.misc diff --git a/changelog.d/14461.misc b/changelog.d/14461.misc new file mode 100644 index 000000000000..cdfa577a4c37 --- /dev/null +++ b/changelog.d/14461.misc @@ -0,0 +1 @@ +Improve performance of `/context` in large rooms.