Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Collect information for PushRuleEvaluator in parallel. #16590

Merged
merged 6 commits into from
Nov 6, 2023

Conversation

clokep
Copy link
Member

@clokep clokep commented Oct 31, 2023

The PushRuleEvaluator requires a bunch of information about the room / sender, etc. based on the new event, most of this information does not depend on each other and can be calculated in parallel.

Additionally bulk_get_push_rules has two separate queries which can be done in parallel.

Ideally we would use PostgreSQL pipeling here instead, but that's not available to use in psycopg2 (or PostgreSQL < 14).

Note that these queries running in parallel will still be subject to thread pool contention, but worse case they get serialized, as they are today.

@clokep
Copy link
Member Author

clokep commented Oct 31, 2023

This has some type hint issues, I think...

@clokep clokep marked this pull request as ready for review November 6, 2023 14:43
@clokep clokep requested a review from a team as a code owner November 6, 2023 14:43
Copy link
Contributor

@DMRobertson DMRobertson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems sane to me. Interested to see if this has a measurable impact!

@clokep clokep merged commit 7e5d3b0 into develop Nov 6, 2023
41 checks passed
@clokep clokep deleted the clokep/push-parallel branch November 6, 2023 20:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants