Description
While JDK-8148937 improved StringJoiner class by replacing internal use of getChars that copies out characters from String elements into a char[] array with StringBuilder which is somehow more optimal, the improvement was marginal in speed (0% ... 10%) and mainly for smaller strings, while GC was reduced by about 50% in average per operation.
Initial attempt in that issue was more involved, but was later discarded because it was apparently using too much internal String details in code that lives outside String and outside java.lang package.
But there is another way to package such "intimate" code - we can put it into String itself and just call it from StringJoiner. This issue is an attempt at doing just that.
Initial attempt in that issue was more involved, but was later discarded because it was apparently using too much internal String details in code that lives outside String and outside java.lang package.
But there is another way to package such "intimate" code - we can put it into String itself and just call it from StringJoiner. This issue is an attempt at doing just that.