Re: RFR: 8283996: Reduce cost of year and month calculations

2022-03-30 Thread Roger Riggs
On Wed, 30 Mar 2022 12:06:39 GMT, Claes Redestad  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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  18.492 ± 
> 0.017  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  20.931 ± 
> 0.013  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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.

Marked as reviewed by rriggs (Reviewer).

-

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


Re: RFR: 8283996: Reduce cost of year and month calculations

2022-03-30 Thread Naoto Sato
On Wed, 30 Mar 2022 12:06:39 GMT, Claes Redestad  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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  18.492 ± 
> 0.017  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  20.931 ± 
> 0.013  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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.

Marked as reviewed by naoto (Reviewer).

-

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


Re: RFR: 8283996: Reduce cost of year and month calculations

2022-03-30 Thread Stephen Colebourne
On Wed, 30 Mar 2022 12:06:39 GMT, Claes Redestad  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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  18.492 ± 
> 0.017  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  20.931 ± 
> 0.013  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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


Re: RFR: 8283996: Reduce cost of year and month calculations

2022-03-30 Thread Claes Redestad
On Wed, 30 Mar 2022 16:08:15 GMT, Brian Burkhalter  wrote:

> Looks all right assuming tests pass.

Thanks! Tier1+2 testing passed.

-

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


Re: RFR: 8283996: Reduce cost of year and month calculations

2022-03-30 Thread Brian Burkhalter
On Wed, 30 Mar 2022 12:06:39 GMT, Claes Redestad  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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  18.492 ± 
> 0.017  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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:
> 
> BenchmarkMode  Cnt   Score   
> Error   Units
> GetYearBench.getYearFromMillisZoneOffsetthrpt   15  20.931 ± 
> 0.013  ops/ms
> GetYearBench.getYearFromMillisZoneRegionthrpt   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.

Looks all right assuming tests pass.

-

Marked as reviewed by bpb (Reviewer).

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


RFR: 8283996: Reduce cost of year and month calculations

2022-03-30 Thread Claes Redestad
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:

BenchmarkMode  Cnt   Score   Error  
 Units
GetYearBench.getYearFromMillisZoneOffsetthrpt   15  18.492 ± 0.017  
ops/ms
GetYearBench.getYearFromMillisZoneRegionthrpt   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:

BenchmarkMode  Cnt   Score   Error  
 Units
GetYearBench.getYearFromMillisZoneOffsetthrpt   15  20.931 ± 0.013  
ops/ms
GetYearBench.getYearFromMillisZoneRegionthrpt   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.

-

Commit messages:
 - Reduce cost of year and month calculations

Changes: https://git.openjdk.java.net/jdk/pull/8039/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk=8039=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8283996
  Stats: 12 lines in 2 files changed: 6 ins; 1 del; 5 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8039.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8039/head:pull/8039

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