Do long type names impact on performance?

java, jvm

Solution

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.

Problem

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.

Original source