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

fix: use combinations in the breakdowns test for perf #26325

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

skoob13
Copy link
Contributor

@skoob13 skoob13 commented Nov 21, 2024

Problem

Only combinations of elements matter in the test. The original test has 336 iterations, while with combinations this count is reduced to 56 still using three elements.

Changes

Use combinations instead of permutations, as permutations are unnecessary.

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

N/A

@skoob13 skoob13 requested a review from aspicer November 21, 2024 08:49
@@ -3844,7 +3844,7 @@ def test_trends_event_multiple_breakdowns_combined_types(self):
Breakdown(type="group", group_type_index=0, property="industry"),
]

for breakdown_filter in itertools.permutations(breakdowns, 2):
for breakdown_filter in itertools.combinations(breakdowns, 3):
Copy link
Contributor

Choose a reason for hiding this comment

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

should we do combinations 2 instead of combinations 3?

this will halve it again, correct? from 56 to 28.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Initially, I thought keeping three combinations would be safer for a regression test. I couldn’t find a good reason to do so now, so I changed it to two.

@skoob13 skoob13 enabled auto-merge (squash) November 22, 2024 17:27
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.

2 participants