Unnecessary allocation in Type.{getReturnType, getArgumentTypes}
These methods currently convert the method descriptor string to an char[] before parsing.
Flight Recorder profiles of the Scala Compiler, which use ASM for bytecode analysis and writing, show these to be a source of allocation pressure.
Have you considered using String.charAt
in the parsing code?
We (the Scala team) are happy to propose a code change with some supporting benchmarks, but first wanted to check for any prior discussions that might be relevant.