


What is the difference between Compact Strings and Compressed Strings in Java 9?
Compressed StringsIntroduced in Java 9 to replace Java 6’s Compressionstring. Its implementation uses byte[] arrays instead of char[] arrays, and introduces a new field encoder to identify whether it is LATIN1 or >UTF16 format, while Compression String has been introduced in Java 6, it is possible to use bytes[]each A one-byte array of characters, and continues with a char[] array of two bytes per character, which could previously be opened with -XX: UseCompressedStrings. p>
Unlike compressed strings, compressed strings do not require unpacking or repacking. Therefore, compact strings provide better performance at runtime.
CompressionString is not enabled by default in Java 6 > and needs to be set explicitly using the following command
<strong>XX:+UseCompressedStrings</strong>
Compact Strings Enabled by default in Java 9, use the following command
<strong>+XX:-CompactStrings</strong>
The above is the detailed content of What is the difference between Compact Strings and Compressed Strings in Java 9?. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 English version
Recommended: Win version, supports code prompts!

Dreamweaver Mac version
Visual web development tools

Zend Studio 13.0.1
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function