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: Use Caffeine for caching compiled scripts in JSR223 samplers instead of commons-collections4 LRUMap #5909

Merged
merged 1 commit into from
May 11, 2023

Conversation

vlsi
Copy link
Collaborator

@vlsi vlsi commented May 11, 2023

Motivation and Context

Caffeine is a much more robust caching solution, so it makes sense to use it instead of the older LRUMap.

@vlsi vlsi added this to the 5.6 milestone May 11, 2023
@vlsi vlsi force-pushed the lrumap_jsr223 branch 3 times, most recently from 09ea6a6 to a93ddda Compare May 11, 2023 12:38
@vlsi vlsi force-pushed the lrumap_jsr223 branch from a93ddda to 5380e59 Compare May 11, 2023 12:39
@vlsi vlsi merged commit 5380e59 into apache:master May 11, 2023
@vlsi vlsi deleted the lrumap_jsr223 branch May 11, 2023 12:42
@owenpahl
Copy link

owenpahl commented Aug 7, 2023

@vlsi, I know this change is old and is already in master for a while now.
But I was looking through it as I was curious about the change to Caffeine, and I can't see anywhere in the source where compiled scripts are added to the new cache. There only appears to be two references to the cache, one to see if a script is present

CompiledScript compiledScript = COMPILED_SCRIPT_CACHE.get(newCacheKey, compiler);
and emptying the cache at the end of a test

@vlsi
Copy link
Collaborator Author

vlsi commented Aug 7, 2023

get creates a value if needed: https://www.javadoc.io/doc/com.github.ben-manes.caffeine/caffeine/2.0.3/com/github/benmanes/caffeine/cache/Cache.html

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