On Wed, 30 Mar 2022 12:06:39 GMT, Claes Redestad <redes...@openjdk.org> wrote:

> A few integer divisions and multiplications can be replaced with test + 
> addition, leading to a decent speed-up on java.time microbenchmarks such as 
> `GetYearBench`. Numbers from my local x86 workstation, seeing similar 
> speed-up on aarch64 and other x86 setups.
> 
> Baseline:
> 
> Benchmark                                            Mode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffset            thrpt   15  18.492 ± 
> 0.017  ops/ms
> GetYearBench.getYearFromMillisZoneRegion            thrpt   15   6.121 ± 
> 0.135  ops/ms
> GetYearBench.getYearFromMillisZoneRegionNormalized  thrpt   15  18.936 ± 
> 0.012  ops/ms
> GetYearBench.getYearFromMillisZoneRegionUTC         thrpt   15   9.283 ± 
> 0.222  ops/ms
> 
> Patched:
> 
> Benchmark                                            Mode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffset            thrpt   15  20.931 ± 
> 0.013  ops/ms
> GetYearBench.getYearFromMillisZoneRegion            thrpt   15   6.858 ± 
> 0.167  ops/ms
> GetYearBench.getYearFromMillisZoneRegionNormalized  thrpt   15  20.923 ± 
> 0.017  ops/ms
> GetYearBench.getYearFromMillisZoneRegionUTC         thrpt   15  10.028 ± 
> 0.182  ops/ms
> 
> 
> Testing: java.time tests locally, CI tier1+2 ongoing.

I'm happy, based on the assertion that it produces the same result and is 
faster.

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

Marked as reviewed by scolebourne (Author).

PR: https://git.openjdk.java.net/jdk/pull/8039

Reply via email to