~/talk

A Sneak Peek at the Stable Values API

Talkat JavaOne 2025 · 2025-03-18..03-20· [java]
github:minborg
slides:none on file

A single-class API (StableValue, JEP 502) exposes safe wrappers around jdk.internal.vm.annotation.@Stable so lambdas run at most once and the VM can constant-fold values, summarized by the slogan codes like lazy initialization, performs like a constant. Live demos build stable suppliers and stable collections (including a stable supplier factory), a Fibonacci stable-list for n=46, and microbenchmarks showing ~0.7 ns/op vs ~6 ns/op for a ConcurrentHashMap cache (~10× faster); records are fast but ordinary instance fields lose trustability.

AI-written summary · about

  1. 0:00Introduction to stable values
  2. 1:24Motivation and JEP 502
  3. 2:42Live coding: Enterprise app
  4. 10:12Introducing stable values
  5. 11:53Stable functions and lists
  6. 15:08Practical use cases
  7. 21:35Performance benchmarks
  8. 22:56Custom stable constructs
  9. 28:24Advanced trust patterns
  10. 34:06Refactoring with stable values
  11. 36:57Summary and conclusion
  12. 41:14Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.