In compiled languages, your code is translated into machine language. The variables you call "foo", "bar", "_auxTempObj" etc... Saw sequences of zeros and ones generated at compiler convenience.
Today’s processors have "input ports" for their records that pass 64 bits at a time (this is the meaning of the 64-bit architecture ;) ), so anything with less than that is completed with zeros.
Thus, the relationship between name size and performance is practically irrelevant. Variables shall be named in such a way that they are legible by persons, not by machines.
Now for the interpreted languages.
The simple act of reading a word is an algorithm of complexity O(n). Who is nerd studied enough to understand this already understood that the conclusion for interpreted languages is the same conclusion for compiled languages.
In human language, what this means is that reading variable names is "cheap" computationally. In practical terms, variable names will not be the bottleneck when interpreting your code. The simple act of determining the scopes of each part of the code is orders of magnitude more expensive than reading the names. So once again, name the variables thinking about who will keep your code.
Even if that weren’t true... an interpreter can ride a hash table with variable names and working with hashes. Depending on the algorithm, this would be equivalent to having all variable names of the same size. Again, it’s not worth worrying about.
Just to conclude: I have said several times that you should not worry about the impact on performance. But the fact that you have thought that this can affect the performance of the program, this curiosity, is the mark of the good developer. Even if any reason for concern is undone by theory and practice, the concepts you need to know to understand this question will help you program better.
Related or duplicated: http://answall.com/questions/31485/o-size-de-uma-fun%C3%A7%C3%A3o-affects-a-performance-e-consumo-de-mem%C3%B3ria It’s not exactly the same thing but I think it’s the same purpose. Summarizing the link: in compiled languages the names disappear, in fully interpreted languages there is so much inefficiency that one more will not make a difference (or, already have to parse even that the size is worth being smaller? ). When making statements it would be good to cite examples to give more context. You may have a specific reason. Is it dup? If not, I’ll answer.
– Maniero
@bigown I think the difference between there and here is that in the other question we analyzed the size of the function. Here we analyze the size of the names of the variables.
– Oralista de Sistemas
I was curious to know which frameworks have function names and variables so small that it is remarkable as a common feature among them. What are?
– Caffé