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

Reduce set building in get_entities_changed #3521

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Jul 12, 2018

This line shows up as about 5% of cpu time on a synchrotron:

not_known_entities = set(entities) - set(self._entity_to_key)

Presumably the problem here is that _entity_to_key can be largeish, and
building a set for its keys every time this function is called is slow.

Here we rewrite the logic to avoid building so many sets.

richvdh added 2 commits July 12, 2018 11:37
This line shows up as about 5% of cpu time on a synchrotron:

    not_known_entities = set(entities) - set(self._entity_to_key)

Presumably the problem here is that _entity_to_key can be largeish, and
building a set for its keys every time this function is called is slow.

Here we rewrite the logic to avoid building so many sets.
@richvdh richvdh requested a review from a team July 12, 2018 10:45
@richvdh richvdh merged commit 6dff49b into develop Jul 12, 2018
@richvdh richvdh deleted the rav/optimise_stream_change_cache branch July 18, 2018 13:28
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