Oracle took seriously the development of JDK9 and published the first list of "suggestions for improvement" (JEP), which describe the new features of Java 9. The list is small and conservative, but it will probably be supplemented in the next two years before the release of Java 9.
Software interfaces
Three new software interfaces are presented.
- Process API update for better interaction with non-Java operating system processes (now developers often have to use native code).
- New HTTP client with support for HTTP 2.0, web sockets and replacing the obsolete HttpURLConnection.
- Lightweight JSON API for processing and generating JSON documents and data streams.
Performance / JVM
Here, too, proposed three improvements (for a start).
')
- Improved conflict resolution when locking (contended locking) when multi-threading and sharing of multiple threads to objects. This is a general performance improvement due to the acceleration of monitor operations, such as
notify/notifyAll
and PlatformEvent::unpark()
. - The smart Java compiler (sjavac) will be enhanced to the extent that it is used by default in JDK builds and on an ongoing basis for building other large projects. Now it is not suitable for these purposes for various reasons, including due to unstable work. The compiler code is completely reworked and tested. It may even be released as a separate independent application without being bound to the JDK. It is planned to implement in it new functions, including parallel and shared compilation.
- Segmentation of the code cache . This area is used by the JVM when JIT compilation is enabled, it caches the compiled platform-dependent code. After upgrading, the cache will be divided into several parts, each of which will contain a compiled code of a certain type:
non-method
(internal JVM code), profiled
and non-profiled
. This will increase productivity and make it easier to implement future extensions.
One More Thing ...
Another new feature in Java 9 is the standard
modular structure of the JDK source code .
src / $ MODULE / {share, $ OS} / classes / $ PACKAGE / *. java
native / include / *. {h, hpp}
$ LIBRARY / *. {C, cpp}
conf / *
The change will not affect the binaries in any way, but it will greatly improve the work with source codes: it will be easier to port Java to mobile devices, “cutting off” unnecessary modules, it will be easier to study the code structure and look for bugs / vulnerabilities, etc. Ultimately, this will lead to improved application performance, and to simplify the creation and support of libraries and large projects on the Java SE and EE platforms.
Code refactoring will be a continuation of the old
Jigsaw project .
Previously announced a
few dozen minor improvements in Java 9, but these, which are announced now, are the most significant.