Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread olivergillespie
> Improve the speed of Enum.hashCode by caching the identity hashcode on first > use. I've seen an application where Enum.hashCode is a hot path, and this is > fairly simple speedup. The memory overhead is low; in enums with no extra > fields there is already a 4-byte space due to alignment so t

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread Pavel Rappo
On Mon, 17 Apr 2023 16:44:24 GMT, Aleksey Shipilev wrote: > I am okay with this new version, thanks. (You need other commenters to > approve as well.) While there's already one more reviewer who approved this PR (@cl4es) and technically it can be already integrated, I'd leave it for a day or t

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread Roger Riggs
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-17 Thread John R Rose
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-18 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 23:38:31 GMT, John R Rose wrote: > I do have one comment: Since identity hash codes are typically reasonably > well-conditioned, it is perfectly reasonable to recondition an occasional 0 > by replacing it with 1, in order to store it in a stable variable for later > reuse.

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-19 Thread Aleksey Shipilev
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-19 Thread Chen Liang
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-19 Thread Andrei Pangin
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-19 Thread Pavel Rappo
On Wed, 19 Apr 2023 13:50:49 GMT, Aleksey Shipilev wrote: > @AlanBateman, @apangin, @ExE-Boss, @liach, @pavelrappo -- you had comments on > this PR, could you please see if those are still relevant or not addressed? > If you are good with the current version, can you please formally approve the

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-20 Thread olivergillespie
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-20 Thread Jorn Vernee
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra

Re: RFR: 8306075: Micro-optimize Enum.hashCode [v6]

2023-04-20 Thread Jorn Vernee
On Mon, 17 Apr 2023 16:42:38 GMT, olivergillespie wrote: >> Improve the speed of Enum.hashCode by caching the identity hashcode on first >> use. I've seen an application where Enum.hashCode is a hot path, and this is >> fairly simple speedup. The memory overhead is low; in enums with no extra