mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Optimize ClassNameReader.getClassName via direct ASM API
getClassName now calls ClassReader.getClassName() directly instead of routing through the visitor-based getClassInfo. Previously, it allocated a List and a ClassVisitor and decoded super_class and every interface name only to discard all but the first element. The method is on the hot path of every CGLIB proxy class definition, so this change significantly lowers its per-call processing cost. Closes gh-36814 Signed-off-by: cookie-meringue <daehyeon3351@gmail.com>
This commit is contained in:
committed by
Brian Clozel
parent
ee5c82a2f8
commit
83e29382b3
@@ -34,9 +34,11 @@ public class ClassNameReader {
|
||||
private static class EarlyExitException extends RuntimeException {
|
||||
}
|
||||
|
||||
// SPRING PATCH BEGIN
|
||||
public static String getClassName(ClassReader r) {
|
||||
return getClassInfo(r)[0];
|
||||
return r.getClassName().replace('/', '.');
|
||||
}
|
||||
// SPRING PATCH END
|
||||
|
||||
public static String[] getClassInfo(ClassReader r) {
|
||||
final List<String> array = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user