Value Objects in Valhalla
summary
Project demonstrates concrete VM and language changes to make objects value objects (no identity, all-final fields), including new class flags, a V_NEW constructor model and bytecodes like V_NEW/ACONST_INIT/withfield, plus null-restricted types to enable flattened heap storage. Early-access builds run benchmarks: an image-blur workload removes GC churn, and a 1M-element NBA event array drops from ~123ms to ~90ms (20–30%); randomizing object layout turns that advantage into a 5–6x slowdown. Implementation exists in OpenJDK Valhalla prototypes and needs further heap-flattening design.
AI-written summary · about
chapters (16)
- 0:00Intro
- 1:07Valhalla Project Links
- 1:59Valhalla Project Goals
- 3:23Primitives vs. Objects
- 6:18Single Storage Location vs. Freely Copyable
- 13:28Value & Identity Objects
- 14:47Value & Identity Classes
- 16:54Value Class Example
- 19:34Implications
- 29:58Implicit Constructors
- 32:59Concurrent Reads & Writes
- 36:13Unlocking Heap Flattening
- 41:14Effects of Flattened Heap Storage
- 43:03Class File Support for Value Classes
- 45:43Class File Optimization Hints
- 46:37Class File Support for Flattened Heap Storage
related talks
47mValue Objects - The Next Big Thing in Java
51mValhalla - Where Are We?
51mProject Valhalla: Flat Value Types in Java
35mValhalla Update
52mValhalla - Where Are We?
51mProject Valhalla Update
20mCache Me If You Can: Speed Up Your JVM with Project Valhalla
57mJava Value Types: what is it and why are they important
