RFR: 8328572: JFR: Use Class.forPrimitiveName(String)
Chen Liang
liach at openjdk.org
Tue May 14 23:32:01 UTC 2024
On Tue, 14 May 2024 17:58:36 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> Could I have a review of change that use Class.forPrimitiveName(String) instead checking against every primitive type.
>
> Testing: jdk/jdk/jfr
>
> Thanks
> Erik
src/jdk.jfr/share/classes/jdk/jfr/internal/util/Utils.java line 253:
> 251: Object array = Array.newInstance(componentType, length);
> 252: for (int index = 0; index < length; index++) {
> 253: Array.set(array, index, values.get(index));
Note that `Array.set` is slow (see [JDK-8051447](https://bugs.openjdk.org/browse/JDK-8051447)); yet this woudld be fine if this is not on hot code paths.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/19235#discussion_r1600777045
More information about the hotspot-jfr-dev
mailing list