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

feat: uses memoization to decrease memory consumption. #220

Merged
merged 2 commits into from
Sep 26, 2023

Conversation

jcchavezs
Copy link
Member

@jcchavezs jcchavezs commented Aug 10, 2023

This PR enables memoization of builders for regex and aho-corasick dictionaries to reduce memory consumption in deployments that launch several coraza instances (e.g. several authorities). For more context check corazawaf/coraza-caddy#76

magefiles/magefile.go Outdated Show resolved Hide resolved
Given that this wasm-extension does not have hot reload (instead we delegate that responsibility to the proxy) we could enable the memoize_builders by default as there is no risk to memory leak as every time the cache is being purgued.
Copy link
Member

@M4tteoP M4tteoP left a comment

Choose a reason for hiding this comment

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

lgtm, yay for the links :D

@jcchavezs jcchavezs merged commit 12fecdc into main Sep 26, 2023
2 checks passed
@jcchavezs jcchavezs deleted the uses_memoization branch September 26, 2023 08:54
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.

3 participants