Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-07-12 Thread Chen Liang
On Mon, 3 Jun 2024 18:00:35 GMT, Sean Gwizdak wrote: >> Improve the speed of Method.hashCode by caching the hashcode on first use. >> I've seen an application where Method.hashCode is a hot path, and this is a >> fairly simple speedup. The memory overhead is low. >> >> This addresses issue >

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-07-12 Thread duke
On Mon, 3 Jun 2024 18:00:35 GMT, Sean Gwizdak wrote: >> Improve the speed of Method.hashCode by caching the hashcode on first use. >> I've seen an application where Method.hashCode is a hot path, and this is a >> fairly simple speedup. The memory overhead is low. >> >> This addresses issue >

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-07-11 Thread Aleksey Shipilev
On Tue, 11 Jun 2024 08:58:34 GMT, Aleksey Shipilev wrote: >> Sean Gwizdak 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 six additional >> comm

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-07-10 Thread Sean Gwizdak
On Tue, 11 Jun 2024 08:58:34 GMT, Aleksey Shipilev wrote: >> Sean Gwizdak 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 six additional >> comm

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-07-10 Thread Chen Liang
On Mon, 3 Jun 2024 18:00:35 GMT, Sean Gwizdak wrote: >> Improve the speed of Method.hashCode by caching the hashcode on first use. >> I've seen an application where Method.hashCode is a hot path, and this is a >> fairly simple speedup. The memory overhead is low. >> >> This addresses issue >

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-11 Thread Aleksey Shipilev
On Mon, 3 Jun 2024 18:00:35 GMT, Sean Gwizdak wrote: >> Improve the speed of Method.hashCode by caching the hashcode on first use. >> I've seen an application where Method.hashCode is a hot path, and this is a >> fairly simple speedup. The memory overhead is low. >> >> This addresses issue >

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-07 Thread Claes Redestad
On Wed, 5 Jun 2024 13:45:46 GMT, Per Minborg wrote: >> As a note, If we would have access to the contemplated `StableValue` and >> `hash` was declared even as an _instance variable_ `StableValue` in >> a regular class, then it would be trusted and would be eligible for constant >> folding due

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-06 Thread Chen Liang
On Thu, 6 Jun 2024 06:41:48 GMT, ExE Boss wrote: >> Sean Gwizdak 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 six additional >> commits since

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread ExE Boss
On Mon, 3 Jun 2024 18:00:35 GMT, Sean Gwizdak wrote: >> Improve the speed of Method.hashCode by caching the hashcode on first use. >> I've seen an application where Method.hashCode is a hot path, and this is a >> fairly simple speedup. The memory overhead is low. >> >> This addresses issue >

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 5 Jun 2024 13:41:10 GMT, Per Minborg wrote: >> In order to be eligible for constant folding, the benchmark must declare the >> `Method hashCodeMethod;` as `static final`. >> >> It is hard for me to understand why a `@Stable` annotation should have a >> detrimental performance impact on

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 5 Jun 2024 13:37:15 GMT, Per Minborg wrote: >> Interesting, don't know about hotspot internals so I can't diagnose the >> exact cause of this regression. > > In order to be eligible for constant folding, the benchmark must declare the > `Method hashCodeMethod;` as `static final`. > > I

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-05 Thread Per Minborg
On Wed, 29 May 2024 15:20:15 GMT, Chen Liang wrote: >> This was something that I tried and I observed a performance regression on >> the ARM platform that I was testing. From my understanding, `@Stable` tells >> the compiler to trust the contents of this field which is only given when >> the f

Re: RFR: 8332249: Micro-optimize Method.hashCode [v2]

2024-06-03 Thread Sean Gwizdak
> Improve the speed of Method.hashCode by caching the hashcode on first use. > I've seen an application where Method.hashCode is a hot path, and this is a > fairly simple speedup. The memory overhead is low. > > This addresses issue > [JDK-8332249](https://bugs.openjdk.org/browse/JDK-8332249).