Since moving to a 6 monthly release cadence, the Java platform is evolving more dynamically than ever before. It can be quite a challenge to stay on top of all the changes and new features. In this talk we're going to explore the most important developments in the Java API: which classes have been added, and what has been removed? Join Duke, the Java mascot, for a trip to space and learn which exciting new APIs provided by the Java platform can help him with his journey:
The Java Vector API for utilizing the SIMD capabilities of modern CPU architectures
The Foreign Linker API for integrating with native code
The JFR Event Streaming API for publishing JDK Flight Recorder Events
We'll also take a look at some useful changes to the Java runtime, such as CDS archives for a faster spaceship..., uhm, application launch!
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
To the moon and beyond with Java 17 APIs! | DevNation Tech Talk
1. To the Moon and Beyond
With Java 17 APIs!
Gunnar Morling
Software Engineer, Red Hat
@gunnarmorling
2.
3.
4. #Java17APIs @gunnarmorling
“Commit [ourselves] to
achieving the goal, before
this decade talk is out, of
landing a man Duke on the
Moon and returning him
safely to the Earth”
Today’s Mission
John F. Kennedy
5. The Vector API 1
JFR Event Streaming
2
3
The Foreign Linker
API
6. #Java17APIs @gunnarmorling
● Projects
○ Debezium
○ Quarkus
○ Hibernate
● MapStruct, JfrUnit, kcctl 🧸
● Java Champion
● @gunnarmorling
Gunnar Morling
Open Source Software Engineer at Red Hat
9. #Java17APIs @gunnarmorling
“Introduce an API to express vector
computations that reliably compile at runtime
to optimal vector instructions on supported
CPU architectures, thus achieving
performance superior to equivalent scalar
computations.”
The Vector API
JEPs 338 / 414 / 417
JEP 417
10. #Java17APIs @gunnarmorling
The Vector API
Goals
Clear and concise API
1
Reliable runtime compilation
and performance on
x64 (SSE, AVX) and
AArch64 (NEON, SVE)
2
3 4
Platform agnostic
Graceful degradation
23. #Java17APIs @gunnarmorling
The Vector API
Examining Native Assembly
"conditionally copies
byte elements from
the source operand to
the destination
operand depending
on mask bits defined
in the implicit third
register argument"
felixcloutier.com
30. #Java17APIs @gunnarmorling
● Accessing native Memory (JEP 383)
● Accessing native APIs (JEP 389)
○ Moving specific parts to native code
○ Using existing native libraries
● Vector API
Projekt Panama
Integration of JVM and Native Code
40. #Java17APIs @gunnarmorling
OpenJDK Flight Recorder
● “JVM framework for troubleshooting,
monitoring and profiling”
● 150+ built-in event types
● Support for custom events
● Open source since Java 11
● Meant for “Always on” usage in production
45. #Java17APIs @gunnarmorling
● Performance tests based on metrics like latency/throughput
often unstable
● JfrUnit
○ Assertions based on proxy metrics
○ Plain JUnit-Tests
○ Analysis via JDK Mission Control
JFR Event Streaming
Use Case: Performance Regression Tests with JfrUnit
“Unit testing,
for performance”
53. #Java17APIs @gunnarmorling
● Class Data Sharing: Memory mapped class metadata
● Default CDS archive for JDK classes since Java 12 (JEP 341)
● AppCDS: CDS archive for your own classes
Detour: Faster Start-up with AppCDS
No Need to Go Native?
59. #Java17APIs @gunnarmorling
● Shenandoah GC
● Improvements to native GraalVM binaries
○ JFR support
○ Debug symbols
● AArch64/Linux port; project Lilliput
● Persistent memory support (JEP 352, mashona.io)
● Supported OpenJDK distribution
Red Hat & OpenJDK
Past and Current Contributions
60. #Java17APIs @gunnarmorling
● JEP Search
https://chriswhocodes.com/jepsearch.html
● Blog (Vector API, JFR Event Streaming,
AppCDS, etc.)
https://www.morling.dev/
● JfrUnit
https://github.com/moditect/jfrunit
● Red Hat build of OpenJDK
https://developers.redhat.com/products/openjdk/overview
Resources