RFR: 8338532: Speed up the ClassFile API MethodTypeDesc#ofDescriptor
Claes Redestad
redestad at openjdk.org
Mon Aug 19 06:32:23 UTC 2024
On Sat, 17 Aug 2024 00:39:35 GMT, Shaojin Wen <duke at openjdk.org> wrote:
> 1. In the scenario without parameters, the performance is regressed.
You might be able to regain (some of) this by adding a check for `start == end` at the top of even before calling `paramTypes`
> 3. When the number of parameters is >8, the performance is regressed.
Under the assumption that low arity methods greatly outnumber high arity ones, some cost here would be acceptable. But let's try to avoid it while keeping things simple.
An option would be to split the code into a fast-path that has an unrolled loop dealing with N args, then a slow path that does more or less the old logic with an ArrayList which we fall back to as soon as we hit either an argument that is too long or we go past N.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20611#issuecomment-2294506811
More information about the core-libs-dev
mailing list