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

Make unneeded count operation optional in clean-duplicate-history. #1014

Closed
bigtimecriminal opened this issue Jul 21, 2022 · 0 comments · Fixed by #1015
Closed

Make unneeded count operation optional in clean-duplicate-history. #1014

bigtimecriminal opened this issue Jul 21, 2022 · 0 comments · Fixed by #1015

Comments

@bigtimecriminal
Copy link
Contributor

bigtimecriminal commented Jul 21, 2022

Problem Statement
Performance of the clean-duplicate-history function could be optimized.

Describe the solution you'd like
I want to suggest a simple improvement. There's nested count operation the result of which is only using in a log statement at verbosity level 2: https://github.com/jazzband/django-simple-history/blob/master/simple_history/management/commands/clean_duplicate_history.py#L69

I'd like to run count only if we actually log the result. Otherwise we should use exists.

Describe alternatives you've considered
None. I think this is a pretty simple change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant