Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do long type names impact on performance?

Tags:

java

jvm

Type name like com.example.Dog will be compiled to com/example/Dog in the .class file. How will most JVM optimize it? It seems longer type names (or member names) need more string compares.

like image 780
Xiè Jìléi Avatar asked Dec 09 '22 00:12

Xiè Jìléi


1 Answers

Long type (class and interface) names take up room in the symbol tables. The names are used at linking time as described in detail in Chapter 5 of the Java Virtual Machine Specification. Once all this linking is done, the names have no effect on run-time performance unless you are using reflection.

like image 56
Ted Hopp Avatar answered Jan 05 '23 08:01

Ted Hopp