On Thu, 22 Oct 2026 11:24:21 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`.
>> - `com/sun/jdi`: 191 passed (1 excluded by the existing ProblemList)
>> - `vmTestbase/nsk/jdi`: 1143 passed (including 2 skips for a transport 
>> unsupported)
>> - `vmTestbase/nsk/jdwp`: 114 passed (1 excluded by the existing ProblemList)
>> - `vmTestbase/nsk/jdb`: 68 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).
>
> Yunbo Zhang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   8343851: Slow new array creation in case of many classes loaded

Marked as reviewed by cjplummer (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/33414#pullrequestreview-5617607780

Reply via email to