RFR: 8315999: Improve Date toString performance [v7]

温绍锦 duke at openjdk.org
Tue Sep 12 13:13:43 UTC 2023


On Mon, 11 Sep 2023 14:59:25 GMT, 温绍锦 <duke at openjdk.org> wrote:

>> The performance of optimizing DateTimeFormatter cannot be as fast as using ixed-length buffer directly.
>
> Of course, the optimization of DateTimeFormatter is more general, and we can spend time doing it later. The format of toString is fixed, we can not use DateTimeFormatter.

> Have you considered potentially more generalizable optimizations to `DateTimeFormatter.ISO_INSTANT.format(this)` here?
> 
> Hand-rolling a fixed-length buffer, skipping the `StringBuilder` .. understandably this can have a performance edge, but perhaps a `DateTimeFormatter` like `ISO_INSTANT` can be optimized to get closer to whatever speed-up this gets you - with broader implications.

I submitted an optimization for the commonly used format of DateTimeFormatter::format

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

PR Review Comment: https://git.openjdk.org/jdk/pull/15658#discussion_r1323021409



More information about the security-dev mailing list