Inefficient new Byte, Integer, Character constructor calls in ASM ClassReader [SPR-12365] #16970
Labels
in: core
Issues in core modules (aop, beans, core, context, expression)
type: enhancement
A general enhancement
Milestone
vincent Kim opened SPR-12365 and commented
There are some inefficient new Byte, Character, Integer constructor in ClassReader class.
->
ex) av.visit(name, new Byte((byte) readInt(items[readUnsignedShort(v)])));
It would be better for performance to use static method, valueOf(),.
Such as Byte.valueOf(), Character.valueOf(), Integer.valueOf().
In valueOf method, cached values will be returned.
For giving better performance, use valueOf static method instead of new Constructor.
Affects: 4.1.1
Issue Links:
Referenced from: commits b16048b
The text was updated successfully, but these errors were encountered: