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

Add LRU cache for JSONPointerToSlice and DotPathToSlice. #136

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nibbleshift
Copy link
Contributor

This caches DotPathToSlice and JSONPointerToSlice to prevent unnecessary allocations and string replacements on paths/pointers that are frequently looked up.

@nibbleshift
Copy link
Contributor Author

Closing this out and submitting a PR to benthos.

@nibbleshift nibbleshift closed this May 8, 2023
@nibbleshift nibbleshift reopened this Aug 24, 2023
@nibbleshift
Copy link
Contributor Author

@Jeffail Can we revisit this PR and discuss a bit more? I submitted a PR in benthos here redpanda-data/connect#1890, but I really don't like my PR for benthos. It results in some sprawling code changes that are just ugly.

If you're open to it, I'd like to re-review this PR and possibly make some updates. Making the change in gabs is much more straight-forward and cleaner.

@nibbleshift
Copy link
Contributor Author

Benchmarks

main:
image

With cache:
image

@nibbleshift
Copy link
Contributor Author

Benchmarks:

main
image

cache:
image

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.

1 participant