<i18n dev> RFR: 8345668: ZoneOffset.ofTotalSeconds performance regression [v4]

Andrey Turbanov aturbanov at openjdk.org
Thu Jan 2 19:54:00 UTC 2025


On Thu, 2 Jan 2025 18:11:53 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> The change made in [JDK-8288723](https://bugs.openjdk.org/browse/JDK-8288723) seems innocuous, but it caused this performance regression. Partially reverting the change (ones that involve `computeIfAbsent()`) to the original. Provided a benchmark that iterates the call to `ZoneOffset.ofTotalSeconds(0)` 1,000 times, which improves the operation time from 3,946ns to 2,241ns.
>
> Naoto Sato has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
> 
>  - Addresses review comments
>  - Merge branch 'master' into JDK-8345668-ofTotalSeconds-perf-regression
>  - Fixed compile error
>  - Update src/java.base/share/classes/java/time/ZoneOffset.java
>    
>    Co-authored-by: Roger Riggs <Roger.Riggs at Oracle.com>
>  - initial commit

src/java.base/share/classes/java/time/ZoneOffset.java line 2:

> 1: /*
> 2:  * Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.

Shouldn't be 2025 too?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/22854#discussion_r1901210626


More information about the i18n-dev mailing list