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

Improving perf when getting limits in storage #184

Merged
merged 1 commit into from
Jun 7, 2023
Merged

Conversation

didierofrivia
Copy link
Member

@didierofrivia didierofrivia commented Jun 7, 2023

This is part of #183

Even tho it's an apparent simple change, the performance improvement is tangible:

Flame graph to compare the overhead simplification

To the left, before the change, then this PR change. It also shows the search for Limit as core::hash
Screenshot 2023-06-07 at 13 10 30

Criterion performance results for In Memory storage, check_rate_limited_and_update function

1 namespaces with 1 limits each with 1 conditions and 1 variable

Screenshot 2023-06-07 at 13 10 50

10 namespaces with 10 limits each with 10 conditions and 10 variables

Screenshot 2023-06-07 at 13 11 36

10 namespaces with 50 limits each with 10 conditions and 10 variables

Screenshot 2023-06-07 at 13 11 56

Notes:

  • From about 6 runs, this one was the least performant
  • The most performant went up to 28 estimate for 10 ns, 50 lim each with 10 conditions and 10 variables

@didierofrivia didierofrivia marked this pull request as ready for review June 7, 2023 11:26
Copy link
Member

@alexsnaps alexsnaps left a comment

Choose a reason for hiding this comment

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

image

@didierofrivia didierofrivia merged commit 3f1a698 into main Jun 7, 2023
@didierofrivia didierofrivia deleted the faster-baby branch June 7, 2023 15:08
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