I wonder if performances of an application could be improved by using the more superclasses you can. My question is about Kotlin, but I assume the answer will be the same for Java.
Let's say you have this inheritance schema (the right class is a subclass of the class on his left):
A < B < C < D < E < F < G < ... And so on until Z.
Saying you don't need all the stuff defined in all the subclasses, but only the attributes and the functions of the A class. For an obscure reason, your code uses only Z class.
My question is quite simple: If you change your code to only use A class instead of Z class, will the code be more performant?
Thank you in advance for your answers.