On Wed, 14 May 2025 19:37:37 GMT, Archie Cobbs <aco...@openjdk.org> wrote:

> Please review this small performance tweak `ArrayDeque`.
> 
> `ArrayDeque` has an invariant in which any unused elements in the array must 
> be null. In a couple of places, the code is setting contiguous ranges of 
> elements to null using `for()` loops. This can be both simplified and sped up 
> by using `Arrays.fill()` instead.

I'm curious to know whether C2 turns the loop into a vectorized operation.  The 
Arrays.fill might be more expressive, but not necessarily faster.

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

PR Comment: https://git.openjdk.org/jdk/pull/25237#issuecomment-2884095477

Reply via email to