RFR: 8337168: Optimize LocalDateTime.toString

Roger Riggs rriggs at openjdk.org
Thu Jul 25 20:59:32 UTC 2024


On Thu, 25 Jul 2024 05:06:17 GMT, Shaojin Wen <duke at openjdk.org> wrote:

> The current LocalDateTime.toString implementation concatenates the toString results of date and time, which can be passed to StringBuilder to reduce additional object allocation and improve performance.

src/java.base/share/classes/java/time/LocalDate.java line 2155:

> 2153:     }
> 2154: 
> 2155:     void formatTo(StringBuilder buf) {

For methods used outside of a class (i.e. not private) a minimal method description is recommended.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20321#discussion_r1692113590


More information about the core-libs-dev mailing list