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

Improve cache hit rate #3

Open
jwanner83 opened this issue May 6, 2022 · 0 comments
Open

Improve cache hit rate #3

jwanner83 opened this issue May 6, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@jwanner83
Copy link
Owner

Instead of matching only exact matches:

cached: [2,1,3] = [1,2,3]

input: [2,1,3] // <- hit
input: [3,2,1] // <- no hit, even though the sorted array would look the same

we could match all inputs which contain all numbers of an already cached entry:

cached: [2,1,3] = [1,2,3]

input: [2,1,3] // <- hit
input: [3,2,1] // <- hit

this would improve the cache hit rate by a lot and would prevent the database to be flooded by entries with the same result.

@jwanner83 jwanner83 changed the title Improve Cache matching Improve cache hit rate May 6, 2022
@jwanner83 jwanner83 self-assigned this May 6, 2022
@jwanner83 jwanner83 added the enhancement New feature or request label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant