Psst! A Sneak Peek at StableValue and SegmentMapper
summary
A JEP for StableValue is submitted and the library wraps jdk.internal.vm.annotation.@Stable to let fields and arrays change at most once, enabling JVM constant-folding while allowing deferred initialization; benchmarks show returning a constant at ~0.8ns, double-checked locking is ~2x slower and stable suppliers match constant speed, and a Fibonacci example drops from exponential to O(n) then O(1). SegmentMapper maps MemorySegment to Java records via MemoryLayout/record mappers, composes nested structs, and plans a natural layout feature.
AI-written summary · about
chapters (8)
- 0:00Introduction and motivation
- 2:29Challenges with initialization
- 10:03StableValue API overview
- 15:00StableValue implementation examples
- 20:56Benchmarks and summary
- 23:24Questions and answers
- 34:12Segment Mapper API
- 41:03Closing and final Q&A
related talks
46mA Sneak Peek at the Stable Values API
37mAssembling
45mMinimal Values Under the Hood
20mCache Me If You Can: Speed Up Your JVM with Project Valhalla
51mBeyond ByteBuffers
02h 44mValue Types and Pattern Matching: 1–1, Data at the Center
45mBeyond the Hype: Unpacking the Latest Features of JDK
35mValhalla Update
