How to make your electrons do more in Java?
summary
Shows concrete wins: Vector API (Java 21) compiles explicit SIMD to CPU instructions and on microbenchmarks reduces runtimes (100M-element sum 29ms → 21ms, max 44ms → 22ms, naive quadratic 300ms → 227ms). Introduces TornadoVM + GraalVM which compiles annotated static methods to GPU kernels, handles device memory and can choose CPU vs GPU. Demonstrates a JVM raytracer moving from ~5 FPS on CPU parallel streams to ~60 FPS on GPU. Notes extra boilerplate, limited SIMD coverage, and PCIe transfer as the main bottleneck.
AI-written summary · about
chapters (13)
- 0:00Introduction and speaker background
- 1:22What are SIMD instructions
- 6:03History of SIMD in Java
- 11:30Java Vector API overview
- 18:22Vector API demo and performance gains
- 24:11Pros and cons of Vector API
- 26:18Why Vector API now and data science context
- 27:24GPU programming in Java overview
- 31:48Tornado VM introduction
- 33:40Tornado VM demo with annotations
- 37:34Ray tracer performance comparison
- 40:09Tornado VM benefits and limitations
- 42:18Summary and conclusion
related talks
40mHow to make your electrons do more in Java
51mJava at Speed: Getting the Most Out of Modern Hardware
44mHotspot JVM Auto Vectorization and Vector API
46mJava vs CPU
48mJust-In-Time Compilation for Java Performance: Recent and Ongoing Improvements
56mUsing vectors in Java [...]
43mFrom CPU to GPU and FPGAs: Supercharging Java Applications with TornadoVM
44mWrite Once, Accelerate Everywhere: GPU-Ready Java with TornadoVM
