Skip to content

LruCache optimization to reduce lock contention#5780

Open
pizzi80 wants to merge 1 commit into
eclipse-ee4j:4.1from
pizzi80:4.1_cache
Open

LruCache optimization to reduce lock contention#5780
pizzi80 wants to merge 1 commit into
eclipse-ee4j:4.1from
pizzi80:4.1_cache

Conversation

@pizzi80

@pizzi80 pizzi80 commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

I've refactored LRUCache to switch back to a native
synchronized block and move the factory execution outside of it.

With JEP 491, synchronized is now 100% friendly with Virtual Threads (no pinning),
and the previous ReentrantLock approach with computeIfAbsent
created a sequential bottleneck inside the lock that heavily penalized performance under high concurrency.

Signed-off-by: pizzi80 <paolo@given2.com>
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