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

ByteMachine.doTransition takes 50% execution time with linear increase in latency with rule count increase #193

Open
payalm08 opened this issue Oct 3, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@payalm08
Copy link

payalm08 commented Oct 3, 2024

Latency tends to increase linearly with increase in rules from 3k to 10k

To Reproduce

Steps to reproduce the behavior:
Create Machine instance with 3k/6k/10k rules as below, and run the example query. Results can be captured using jmh.

Example Rule:

{"data.id":["44422","23232","34325"], // size can be in range of 2-50
"data.id.333":[{"exists":false}] // size can be in range of 2-50
}

Example Query:

{"data.id": ["44422", "23232", "34325"]}. // size in range of 1000 or high

Expected behavior

Benchmark are run with 3k/6k/10k rules with query that has array of 1000 or more. Latency increased by 60% or more for every run. For the same query, the increase in latency must be gradual with change in rule count.

Environment:

Java 8 / Mac OS Sonoma 14.7

@payalm08 payalm08 added the bug Something isn't working label Oct 3, 2024
@payalm08 payalm08 changed the title ByteMachine.doTransition takes 50% execution time with latencies seen 160ms ByteMachine.doTransition takes 50% execution time with linear increase in latency with rule count increase Oct 3, 2024
@timbray
Copy link
Collaborator

timbray commented Oct 3, 2024

Question: All the values you're providing look like numbers, but they're actually strings of digits, correct?

The expected latency of Ruler as a function of rule count/shape is (I believe) very similar to that of Quamina, which has a fairly detailed discussion in that repo. One key aspect is the dependency on the number of unique keys. Anyhow, see https://github.com/timbray/quamina?tab=readme-ov-file#flattening-and-matching and especially https://github.com/timbray/quamina?tab=readme-ov-file#matchesforevent-performance

@payalm08
Copy link
Author

payalm08 commented Oct 4, 2024 via email

@timbray
Copy link
Collaborator

timbray commented Oct 4, 2024

I don't think that should make a difference, but the value being 1634 vs "1634" might. But apparently that's not what's happening here.

@payalm08
Copy link
Author

payalm08 commented Oct 18, 2024 via email

@payalm08
Copy link
Author

payalm08 commented Oct 18, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants