RFR: 8305811: (bf) Improve heap buffer performance of CharBuffer::append(CharSequence)

Alan Bateman alanb at openjdk.org
Tue Apr 11 19:08:33 UTC 2023


On Tue, 11 Apr 2023 18:15:16 GMT, Brian Burkhalter <bpb at openjdk.org> wrote:

> **Before**
> 
> ```
> Benchmark                              Mode  Cnt        Score       Error  Units
> CharBufferAppend.appendString         thrpt    5  3746966.312 ± 83845.495  ops/s
> CharBufferAppend.appendStringBuffer   thrpt    5  3758222.865 ± 81606.385  ops/s
> CharBufferAppend.appendStringBuilder  thrpt    5  1146190.655 ± 16056.970  ops/s
> ```

Legacy StringBuffer caches its String value. You might have to use sb.setLength or some other op to remove that effect from the benchmark.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/13415#issuecomment-1503955117


More information about the nio-dev mailing list