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

Bench: Actually create different limits for each scenario #180

Merged
merged 1 commit into from
May 23, 2023
Merged

Conversation

alexsnaps
Copy link
Member

So this is going to hurt:

We always created the bench "wrong", or rather we created dups of one identical Limit in each namespace, when it was more than 1 (i.e. 10 & 50). Sadly this meant that Limitador would only ever do one limit (with more variables and conditions tho)... So this fixes that, and as such exposes the O(n) problem I mentioned in our refinement call...

Bench result, compared as to when it was 1 limit, whereas this now are 10 limits to be tested against:

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

In memory:

image

On disk:

image

With Redis:

image

As expected, Memory is the worst: O(n), while Redis, which does an MGET is the least impacted. While the operation is still O(n) within Redis, the network overhead ans (de)serialization dominates the latency here…

@eguzki
Copy link
Contributor

eguzki commented May 23, 2023

That hurts, indeed.

Copy link
Contributor

@eguzki eguzki left a comment

Choose a reason for hiding this comment

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

Does it make sense to document those perf benchmarks and upload to Github?

@eguzki
Copy link
Contributor

eguzki commented May 23, 2023

I am still surprised with the disk performance. I was expecting much worse performance. I guess actual numbers depend on the disk properties.

@alexsnaps
Copy link
Member Author

Does it make sense to document those perf benchmarks and upload to Github?

Eventually maybe, yes... but I'd rather fix that issue first tho

I am still surprised with the disk performance. I was expecting much worse performance. I guess actual numbers depend on the disk properties.

And... this! If we want to publish these, I think we need to have a well controlled environment. These are all from runs on my MacBook Pro M1, with Redis running within Docker. We probably want something more reliable than that to use as a bench.

@alexsnaps alexsnaps merged commit 517630e into main May 23, 2023
@alexsnaps alexsnaps deleted the bench-fix branch May 23, 2023 13:01
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