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

Filterx initial string cache #471

Merged
merged 4 commits into from
Feb 13, 2025
Merged

Conversation

bazsi
Copy link
Member

@bazsi bazsi commented Jan 24, 2025

This PR implements the caching of trivial FilterXString instances (e.g. zero-length and single character numbers), which are commonly found in our log patterns as string values. Instead of allocating these all the time, use a cached instance.

This is "initial" string cache, as I have some pending patches to implement a larger table of strings that could be cached
similarly, but I got to make more testing with those to see how they impact performance.

@bazsi bazsi force-pushed the filterx-initial-string-cache branch from 8fae4d2 to a014552 Compare February 8, 2025 13:52
@bazsi bazsi force-pushed the filterx-initial-string-cache branch 2 times, most recently from 6f38b93 to de75805 Compare February 8, 2025 22:14
The convention is that we are using FilterXObject pointers in interfaces,
and potentially check if the object at runtime matches our expectations.
By using FilterXString instances there, we typed constructors as well
as publish FilterXString as a struct. I am not against publishing
internal structs if they serve optimization purposes, but any value should
rather be passed around as objects and not specific types.

Signed-off-by: Balazs Scheidler <[email protected]>
@bazsi bazsi force-pushed the filterx-initial-string-cache branch from de75805 to 55c2088 Compare February 13, 2025 09:19
@MrAnno MrAnno merged commit a0a400f into axoflow:main Feb 13, 2025
22 checks passed
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