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

Add threshold for eqFilter in p_Dictionary of pp #2525

Merged
merged 1 commit into from
Aug 24, 2022

Conversation

NTH19
Copy link
Contributor

@NTH19 NTH19 commented Aug 23, 2022

For Eq comparasions in p_Dictionary function of pp,the way uses hashmap is faster than for loop,but when the filtercount is less than a magic number N,the for loop method is faster.And I have simply found that N is 6,but it is just an estimate.
image.Accroding to this micro benchmark.The time complexity of for loop is O(n).We can find that when filtercount is 3,the time for loop method is half of eqFilter. So when filtercount is less than 6,the way uses for loop benefits a lop to performance.

@NTH19 NTH19 changed the title Add threshold for eqFiltercount Add threshold for eqFilter in p_Dictionary of pp Aug 23, 2022
@drrtuy drrtuy self-requested a review August 23, 2022 21:37
@drrtuy drrtuy merged commit 7251f58 into mariadb-corporation:develop Aug 24, 2022
@NTH19 NTH19 deleted the useHashmapOrForLoop branch August 24, 2022 11:00
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