New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of getting typing updates for replication #3794

Merged
merged 3 commits into from Sep 27, 2018

Conversation

Projects
None yet
2 participants
@erikjohnston
Member

erikjohnston commented Sep 5, 2018

Fetching the list of all new typing notifications involved iterating
over all rooms and comparing their serial. Lets move to using a stream
change cache, like we do for other streams.

Improve performance of getting typing updates for replication
Fetching the list of all new typing notifications involved iterating
over all rooms and comparing their serial. Lets move to using a stream
change cache, like we do for other streams.

@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Sep 5, 2018

@erikjohnston

This comment has been minimized.

Member

erikjohnston commented Sep 6, 2018

@matrixbot retest this please

erikjohnston added some commits Sep 5, 2018

@richvdh

i has questions

if last_id < serial and serial <= current_id:
for room_id in changed_rooms:
serial = self._room_serials[room_id]
if last_id < serial <= current_id:

This comment has been minimized.

@richvdh

richvdh Sep 19, 2018

Member

TIL you can do this in python.

for room_id, serial in self._room_serials.items():
if last_id < serial and serial <= current_id:
for room_id in changed_rooms:
serial = self._room_serials[room_id]

This comment has been minimized.

@richvdh

richvdh Sep 19, 2018

Member

why do we bother to update and check room_serials as well as the stream change cache?

This comment has been minimized.

@erikjohnston

erikjohnston Sep 20, 2018

Member

Mainly because the stream change caches are bound in size and will drop old rooms. Agreed its a bit wasteful to have both, but I'm not sure the best way of amalgamating them without causing us to send down all typing notifications for old clients.

last_id,
)
if changed_rooms is None:

This comment has been minimized.

@richvdh

richvdh Sep 19, 2018

Member

I can't see why this would happen.

This comment has been minimized.

@erikjohnston

erikjohnston Sep 20, 2018

Member

get_all_entities_changed can return None if last_id is sufficiently old?

@erikjohnston erikjohnston assigned richvdh and unassigned erikjohnston Sep 20, 2018

@richvdh richvdh self-requested a review Sep 27, 2018

@richvdh

I swear I meant to approve this days ago

@richvdh richvdh merged commit 36c62a6 into develop Sep 27, 2018

10 checks passed

ci/circleci: sytestpy2 Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgres Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3 Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgres Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@richvdh richvdh deleted the erikj/faster_typing branch Sep 27, 2018

@richvdh

This comment has been minimized.

Member

richvdh commented Sep 27, 2018

(oh, I was going to grumble about lack of comments to explain what was going on. nm.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment