JetBrains has released Kotlin 1.4.20, an upgrade to its , with an experimental capability for JVM-based string concatenation via the dynamic method invocation leading a list of new features.
String concatenation on the JVM since has been done via the , the
invokedynamiccode instruction in the bytecode. This is faster and consumes less memory than the previous implementation and leaves room for future optimizations without needing bytecode changes.
This mechanism is now being implemented in Kotlin to improve performance. String concatenations now can be compiled into dynamic invocations for JDK 9 or later targets. The experimental feature can be invoked for the following use cases, via adding the
String.plus in the operator (a + bcode), explicit (a
.plus(b)), and reference (
toStringon inline and data classes.
- String templates, except for those with a single non-constant argument.
Developers must invoke one of the following rules to use
JetBrains announced the release of Kotlin 1.4.20 on November 23. The command line compiler for Kotlin 1.4.20 can be downloaded from . IntelliJ Idea and Android Studio IDE users can find instructions for updating their Kotlin plug-in .
Kotlin 1.4.20 also features the following:
capability is featured, configurable from the Gradle build script.
java.nio.file.Path.Also, the performance of the
String.Replacefunction has been improved.
Copyright © 2020 IDG Communications, Inc.