Introduction to some new features of Java 9

Accepted characteristics 1 Jigsaw project; Modular source code

Jigsaw project is to modularize java code and divide JRE into components that can cooperate with each other, which is also one of many features of Java 9. JEP is the first of four steps towards jigsaw. It will not change the real structure of JRE and JDK. JEP is to modularize JDK source code, so that the compiling system can compile modules and check module boundaries during construction. This project was originally released with Java 8, but due to the delay, it will be added to Java 9

Once it is complete, it may allow components to be customized according to a project's needs, thereby reducing the size of rt.jar. There are about 20000 classes in the rt.jar package of JDK 7 and JDK 8, but many classes are not used in some specific environments (even if some solutions are included in the compact distribution feature of Java 8, there is class redundancy). This is to make java easy to apply to small computing devices (such as network devices), improve its security and performance, and make it easier for developers to build and maintain these class libraries.

2. Simplify process API

Up to now, the ability of Java to control and manage system processes is limited. For example, in order to easily obtain the process PID of your program, you can either call the local program or use some workarounds yourself. More importantly, each platform needs a different implementation to ensure that you get the right results.

It is expected that the code can obtain Linux PIDs in the following way:

In Java 9, it can be changed as follows (all operating systems are supported):

This update will expand the interaction between Java and the operating system: add some new direct and clear methods to deal with PIDs, process names and states, and enumerate multiple JVMs and processes and more.

3. Lightweight JSON API

At present, there are many java tools for dealing with JSON, but the uniqueness of JSON API is that JSON API will be a part of Java language, lightweight and use the new features of Java 8. It will be placed in Java Util package (but JSON in JSR 353 is handled by a third-party package or other methods)

More about JSR 354

Lock contention is a bottleneck that limits the performance of many Java multithreaded applications The new mechanism has been verified by a variety of benchmarks in improving the performance of Java object monitor, including volano In the test, the communication server opened a large number of processes to connect to the client, many of which applied for the same resource to simulate heavy-duty daily applications

More about JEP 143

More about JEP 197

The first phase of the intelligent java compiler sjavac started with JEP 139, which is used to improve the compilation speed of JDK on multi-core processors Now the project has entered the second phase (JEP 199), which aims to improve sjavac and make it the default General Compiler of Java to replace the current JDK compiler javac

The official HTTP 2.0 RFC (request for comments, official technical discussion / meeting minutes, etc.) is scheduled to be released in February 2015. It is based on the spdy (speed) protocol released by Google Compared with the network based on HTTP 1.1 protocol, the network based on spdy protocol has a significant speed increase of 11.81% to 47.7%. Now some browsers have implemented this protocol

More about the kulla program

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>