za, which is obviously not more efficient from a length standpoint. Is there some reason it is, in fact, more efficient (possibly because of the letters used), or is it just a couple random letters?
For instance, I can imagine that
za might be more compressible than
on when Gzipped, but there's a good chance it's just a couple of random letters.
onis actually likely to be more compressible than
zabecause the Huffman encoding for 'z' might well be longer (more bits) than that of other letters due to it's relative infrequency in standard language - Eric J. 2012-04-04 20:57
After playing around with http://closure-compiler.appspot.com/home some, it seems that the compiler just start renaming the variable regardless of their previous name. It stays at 'a' and makes it way through 'b', etc... It does not appear to care about current length of the variable name, but it will make sure the overall size is the same or smaller than before. In some cases variable may be refactored out of the code if you use the advanced optimization setting.
By letting the compiler handle the naming of your variables it is sure that none of them conflict with each other. If it tried to keep your existing variable name it would have to keep track of that separately and maintain a list to compare against.
Another benefit of minifying code is to obfuscate your code base. Sure someone can figure it out if they really wanted to, but by making the variable names programatic it makes it harder to figure out the meaning.
If you really wanted to debug through combined & minified code I would recommend looking into the source maps feature of Google Chrome Canary http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/
Is there some reason it is, in fact, more efficient (possibly because of the letters used)
or is it just a couple random letters?
Pretty much. AFAIK, Closure Compiler (and other JS minifiers) systematically renames variables, with the goal of using fewer characters overall, without looking at what they are already named.