On Fri, 16 Oct 2026 15:13:08 GMT, Yunbo Zhang <[email protected]> wrote:
> Please review this performance fix. > > For reference arrays, `ArrayType.newInstance()` searches all loaded classes > for the component class, which can be slow when many classes are loaded. > > **Fix:** > > Search the array's class loader first, with the global lookup as a fallback. > Hidden classes continue to use the global lookup. > > **Testing:** > > - Added hidden-class and `int[][]` coverage to `NewInstanceTest`. > - `vmTestbase/nsk/jdi/ArrayType/newInstance`: 4 passed. > - Local JDI `Object[]` measurement with 70,000 additional classes: **17.27 > ms/call -> 0.156 ms/call**. > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Changes look good. Please also run all com/sun/jdi tests and all nsk/jdi, nsk/jdwp, and nsk/jdb tests. ------------- Marked as reviewed by cjplummer (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/33414#pullrequestreview-5554652474
