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

Make calculating push actions faster #2177

Merged
merged 2 commits into from
May 18, 2017
Merged

Conversation

erikjohnston
Copy link
Member

No description provided.

@erikjohnston erikjohnston force-pushed the erikj/faster_push_rules branch from fc7b03b to 295276c Compare May 2, 2017 13:33
@erikjohnston erikjohnston added maintenance A-Performance Performance, both client-facing and admin-facing labels May 8, 2017
@erikjohnston erikjohnston force-pushed the erikj/faster_push_rules branch 6 times, most recently from be0ce1f to e887489 Compare May 16, 2017 16:43
@erikjohnston erikjohnston force-pushed the erikj/faster_push_rules branch 2 times, most recently from 7472680 to a4f1ce8 Compare May 17, 2017 15:32
We add a push rule specific cache that ensures that we can reuse
calculated push rules appropriately when a user join/leaves.
Returns:
RulesForRoom
"""
return RulesForRoom(self.hs, room_id, self._get_rules_for_room.cache)
Copy link
Contributor

@NegativeMjark NegativeMjark May 18, 2017

Choose a reason for hiding this comment

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

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.

Copy link
Contributor

@NegativeMjark NegativeMjark left a comment

Choose a reason for hiding this comment

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

LGTM

@erikjohnston erikjohnston merged commit 6e38118 into develop May 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants