search
HomeJavajavaTutorialWhat is the difference between Compact Strings and Compressed Strings in Java 9?

Java 9中Compact Strings和Compressed Strings之间的区别是什么?

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!

Statement
This article is reproduced at:tutorialspoint. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function