In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article is to share with you what the three new API about Java 9 features are, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article. Without saying much, let's follow the editor to have a look.
Oracle has announced that the Java9*** Enhancement Program set (known as JEPs) has been confirmed to be released in early 2016.
Three new API have been announced:
Process API is updated to interact with non-JAVA-related processes in the operating system, and there are many restrictions on the current use of API, which forces developers to often turn to native code. The main risk of this API is the heterogeneity of the operating system, especially Windows. The API is designed to accommodate the deployment of small devices on different operating systems, and it should also consider the environment in which multiple Java virtual machines are running on the same operating system process. These considerations will lead to a more abstract API, which will increase the design workload.
New HTTP client, which introduces support for HTTP/2.
Problems and implementation of existing API:
URLConnection-based API is designed for a variety of protocols, many of which have been abandoned (ftp, gopher, etc.)
Earlier HTTP 1.1 was too abstract
Difficult to use (many behaviors are undocumented)
Can only work in blocking mode (one thread per request / response)
Very difficult to maintain
Https 2.0 support relies on TLS ALPN (Application Layer Negotiation Extension), which is not currently supported in JDK, and the Http 2.0 specification itself is still in the form of an Internet draft, but it is expected to become a formal draft in 2014.
New lightweight JSON API: it provides a lightweight API for processing and generating JSON documents and data streams, which is based on standardized JSON support and is part of JSR 353.
There are also three JVM performance-related features announced:
Improved contention locks designed to improve performance when threads compete for access to objects. Improved competitive locks can be of great benefit to real-world applications, especially for industrial benchmarks such as Volano and DaCapo.
The project will explore performance improvements in the following areas related to competitive Java monitors:
Field reorder (Field reordering) and cache line alignment (cache line alignment)
Accelerate PlatformEvent::unpark ()
Fast Java monitor operation to enter operation
Fast Java monitor exit operation
Fast Java monitor notify/notifyAll operation
Adaptive spin improvement and SpinPause on SPARC
Split the code cache of the JIT compiler (for better JIT performance on large applications). Decompose the code cache into separate segments, each containing a specific form of compiled code, in order to improve performance and support future extensions.
The organization and maintenance of compiled code can have a huge impact on performance, and if the code cache goes in the wrong direction, several examples of performance degradation will be learned. After the introduction of multi-tier compilation, the status of code caching becomes extremely important, because the amount of compiled code is 2-4 times larger than that without multi-tier compilation. Multi-tier compilation also introduces a new compiled code type: instrumented compiled code (alien code). Alien code has different properties from non-alien code, one of the important differences is that alien code has a predefined restricted life cycle, in contrast, non-alien code will always remain in the code cache.
The existing code cache is optimized for a single code, that is, only one form of compiled code. The code cache is organized into a separate heap data structure located in a contiguous memory block header. As a result, alien code with a predefined restricted life cycle will be mixed with non-alien code and retained in the code cache, which can lead to unused performance and design problems. For example, the sweeper method will be forced to scan the entire code cache when scanning, even if some of the entities are never updated or there is code that is not a method.
Further development of the "smart" Java compiler, called sjavac, supports parallel and shared compilation, among other features.
Due to various problems with stability and portability, sjavac is not used in JDK build scripts by default, and the goal of this JEP is to solve these problems, which involves ensuring that the tool always produces reliable results on all hardware and software configurations.
The overall goal is to improve the quality of sjavac and make it a general javac package with the ability to compile a variety of large Java projects.
Subsequent projects will continue to explore how to separate sjavac from the JDK toolchain, if possible. Sjavac may become a stand-alone supported tool, or a non-independent tool integrated with javac, or something else.
*, an attractive feature has been promised in JEP 201: modular source code. This is actually what we used to know as the modular solution "Jigsaw project" (originally aimed at being part of Java 8).
The Jigsaw project aims to design and implement a standardized module system for the Java SE platform, and apply it to its own platform, and then put it into JDK. Its initial goal is to make the platform implementation easier to extend to small devices, improve security and maintainability, improve application performance, and provide developers with a better tool for large applications.
This JEP is part of the * phase of the Jigsaw project, where JEP will modularize the images of JRE and JDK, followed by the introduction of a module system.
The motivation for reorganizing the source code at an early stage is:
Give JDK developers the opportunity to familiarize themselves with the modular structure of the system.
Continue to push the structure by enforcing module boundaries in the build, even before the introduction of the module system.
Develop Jigsaw projects in depth, rather than always "slowly" converting existing non-modular code into modular code.
These are the three new API of Java 9 features, and the editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.