Skip to content
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

Skip aggregator processing when none have been registered #739

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smsearcy
Copy link

@smsearcy smsearcy commented May 13, 2024

As noted in #700, we noticed the overhead of construct_aggregate_queries() looping through all the objects in the session, even if there were no aggregates defined. Thus, this short-circuits that process if there are no aggregators registered.

Fixes #700

Constructing the aggregate queries looped through all objects in the
session, even if no aggregates had been defined.  This event was
registered, just by importing `sqlalchemy_utils`, leading to unexpected
side effects (slowdown) if a program loaded lots of models into a
session.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Event listener for aggregates can cause performance issues on import
1 participant