Skip to content

refactor: replace LazyMemoizingSupplier with StableValue#1768

Merged
derklaro merged 1 commit intonightlyfrom
drop-lazy-supplier
Oct 9, 2025
Merged

refactor: replace LazyMemoizingSupplier with StableValue#1768
derklaro merged 1 commit intonightlyfrom
drop-lazy-supplier

Conversation

@derklaro
Copy link
Member

@derklaro derklaro commented Oct 9, 2025

Motivation

LazyMemoizingSupplier was added as Java 24 didn't have StableValues yet. They were added as a preview feature in jdk 25, providing better performance due to constant folding at runtime.

Modification

Drop our custom LazyMemoizingSupplier implementation and replace all uses with StableValue.

Result

Our custom function is removed in favor of a new jdk api that provides better runtime performance.

Other context

This api will change in jdk 26 again (see jep draft 526 / JDK-8366178), however the impact on our code will be minimal (looking at the proposed changes today) and given the performance benefits we should migrate regardeless.

@derklaro derklaro added this to the 4.0.0-RC15 milestone Oct 9, 2025
@derklaro derklaro requested a review from 0utplay October 9, 2025 14:35
@derklaro derklaro self-assigned this Oct 9, 2025
@derklaro derklaro added v: 4.X This pull should be included in the 4.0 release t: improvement The pull request improves existing code in: wrapper An issue/pull request releated to the wrapper module code labels Oct 9, 2025
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

Test Results

 56 files  ±0   56 suites  ±0   4m 0s ⏱️ +10s
570 tests ±0  570 ✅ ±0  0 💤 ±0  0 ❌ ±0 
937 runs  ±0  937 ✅ ±0  0 💤 ±0  0 ❌ ±0 

Results for commit 4c6c6af. ± Comparison against base commit c4b42e7.

@derklaro derklaro merged commit eb7690f into nightly Oct 9, 2025
6 checks passed
@derklaro derklaro deleted the drop-lazy-supplier branch October 9, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: wrapper An issue/pull request releated to the wrapper module code t: improvement The pull request improves existing code v: 4.X This pull should be included in the 4.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants