On Mon, 3 Nov 2025 22:58:04 GMT, Chen Liang <[email protected]> wrote:
> I actually wonder if the ArrayList.class path reuses `Object[] a = > c.toArray();` and `int numNew = a.length;`, we are still going to see a > similar improvement - I wonder if the bottleneck is the lack of polymorphic > inlining alone, or if an array copy with a size trim would hamper C2 too. One bottleneck being addressed is the intermediate array creation - gc profiling confirms that exists and is a significant impact. I don't have data showing the presence or absence of other bottlenecks, although the performance of the de-duplicated code suggests that change introduced a side effect. The memory savings were still present so I speculate the change introduced a new bottleneck. ------------- PR Comment: https://git.openjdk.org/jdk/pull/28116#issuecomment-3487518767
