RFR: 8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor

Shaojin Wen duke at openjdk.org
Mon Aug 19 06:41:52 UTC 2024


On Mon, 19 Aug 2024 05:06:32 GMT, Chen Liang <liach at openjdk.org> wrote:

>> regionMatches uses vectorizedMismatch for comparison. The length of `Ljava/lang/Object;` is 18. In the code without intrinsic, it will exit after two long comparisons. If there is vector128 optimization, it will exit after one comparison, and the overhead is very small.
>
> I think you can add a case where the parameters are all these vulnerable names like `Ljava/lang/Objecq;` and repeat 8 times, and see how big a negative impact these close mismatches have.

The scenario of `Ljava/lang/Objecq` does not exist. I have added the following:

(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
(Ljava/lang/Integer;Ljava/lang/Integer;)Ljava/lang/Integer;


In these two scenarios, the length of `Ljava/lang/String;` is the same as that of `Ljava/lang/Object;`, and the length of `Ljava/lang/Integer;` is different from that of `Ljava/lang/Object;`, but the performance is similar. This proves that the performance overhead of regionMatches is very small.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20611#discussion_r1721279267


More information about the core-libs-dev mailing list