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 using InMemory storage #186

Merged
merged 9 commits into from
Jul 11, 2023
Merged

Conversation

didierofrivia
Copy link
Contributor

@didierofrivia didierofrivia commented Jun 12, 2023

This is also part of #183

Criterion performance results for In Memory storage, check_rate_limited_and_update function

Screenshot 2023-07-03 at 16 59 08

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

Screenshot 2023-07-03 at 16 58 54

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

Screenshot 2023-07-03 at 16 58 40 Screenshot 2023-07-03 at 18 05 27

@didierofrivia didierofrivia marked this pull request as ready for review July 3, 2023 16:06
@didierofrivia didierofrivia changed the title Faster baby ii Improving perf when getting limits InMemory storage Jul 3, 2023
@didierofrivia didierofrivia changed the title Improving perf when getting limits InMemory storage Improving perf when using InMemory storage Jul 4, 2023
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.

This looks real good to me, if we could at least clean up the repetition there…

limitador/src/storage/in_memory.rs Outdated Show resolved Hide resolved
limitador/src/storage/in_memory.rs Outdated Show resolved Hide resolved
* Storing now in ExpiringValue type within the main structure of
nested HashMaps
* Making first loop faster not modifying counters, read only
* Second loop updates de counters

[refactor] Refactoring inMemory, check when load_counters in Vacant branch

[refactor] Refactoring inMemory -> fixing performance in check _and_update

[refactor] Refactoring InMemory -> first loop faster, not modifying storage
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.

🙌

@didierofrivia didierofrivia merged commit 1a457d7 into main Jul 11, 2023
17 checks passed
@didierofrivia didierofrivia deleted the faster-baby-ii branch July 11, 2023 08: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