Remove unnecessary allocations in Type
Results of the benchmark on my machine:
CURRENT CODE (3 runs)
getArgumentsAndReturnSizeFromDescriptor thrpt 10 7841,639 ± 202,570 ops/s
getArgumentsAndReturnTypesFromDescriptor thrpt 10 1444,529 ± 41,936 ops/s
getTypeFromDescriptor thrpt 10 4586,855 ± 109,614 ops/s
getArgumentsAndReturnSizeFromDescriptor thrpt 10 7884,111 ± 187,510 ops/s
getArgumentsAndReturnTypesFromDescriptor thrpt 10 1448,835 ± 37,332 ops/s
getTypeFromDescriptor thrpt 10 4578,097 ± 115,033 ops/s
getArgumentsAndReturnSizeFromDescriptor thrpt 10 7868,005 ± 165,286 ops/s
getArgumentsAndReturnTypesFromDescriptor thrpt 10 1453,131 ± 32,611 ops/s
getTypeFromDescriptor thrpt 10 4537,437 ± 111,732 ops/s
NEW CODE (3 runs)
getArgumentsAndReturnSizeFromDescriptor thrpt 10 7868,311 ± 205,813 ops/s
getArgumentsAndReturnTypesFromDescriptor thrpt 10 1400,616 ± 47,122 ops/s
getTypeFromDescriptor thrpt 10 10447,278 ± 285,315 ops/s
getArgumentsAndReturnSizeFromDescriptor thrpt 10 7822,970 ± 180,999 ops/s
getArgumentsAndReturnTypesFromDescriptor thrpt 10 1430,244 ± 39,596 ops/s
getTypeFromDescriptor thrpt 10 10371,893 ± 308,044 ops/s
getArgumentsAndReturnSizeFromDescriptor thrpt 10 7709,202 ± 168,070 ops/s
getArgumentsAndReturnTypesFromDescriptor thrpt 10 1402,382 ± 34,459 ops/s
getTypeFromDescriptor thrpt 10 8851,335 ± 259,663 ops/s
Edited by Eric Bruneton