Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Make calculating push actions faster #2177

Merged
merged 2 commits into from May 18, 2017

Conversation

Projects
None yet
2 participants
Owner

erikjohnston commented May 2, 2017

No description provided.

Faster push rule calculation via push specific cache
We add a push rule specific cache that ensures that we can reuse
calculated push rules appropriately when a user join/leaves.
synapse/push/bulk_push_rule_evaluator.py
+ Returns:
+ RulesForRoom
+ """
+ return RulesForRoom(self.hs, room_id, self._get_rules_for_room.cache)
@NegativeMjark

NegativeMjark May 18, 2017 edited

Contributor

I think it's important that the RulesForRoom object is added to the self._get_rules_for_room.cache before any lookup methods are called on it, otherwise there would be a race in RulesForFroom.invalidate_all between adding the object to the cache and fetching it from the cache to invalidate it.

Might be worth chucking a comment in to that effect.

@erikjohnston erikjohnston merged commit 6e38118 into develop May 18, 2017

0 of 6 checks passed

Sytest Dendron (Commit) Build #2162 origin/erikj/faster_push_rules in progress...
Details
Sytest Dendron (Merged PR) Build started sha1 is merged.
Details
Sytest Postgres (Merged PR) Build triggered. sha1 is merged.
Details
Sytest SQLite (Merged PR) Build triggered. sha1 is merged.
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details
continuous-integration/travis-ci/push The Travis CI build is in progress
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment