With the variable_local_ and variable_global_ family of functions, the variable name is passed as a string, which of course is simply a series of bytes with each byte representing a letter. The fact that these functions even exist to be included in the executable suggests variable names themselves are actually stored in the executable.
Unfortunately, one does not simply view the executable in a hex editor. I tried this and noticed there were a lot of legible words, many of them looked like C (or C+ or whatever) commands and Windows-related commands. I'm not sure if this is wasted space or if the executable really does need all those lines, but it told me it stored some variables by name (even if they were system). I tried an ASCII search for a known variable name and a search for the name with a space between each letter, but that didn't work. That doesn't mean the words aren't in the data, it just means I probably wasn't searching correctly.
Now, I don't know how GM's compiler works, but I tested if changing the length of a variable's name altered the size of the executable. First off, GM does some funky stuff with the file name -- the executable with a 2 added at the end of the file name resulted in a smaller file size than the one with just the original file name (I tested this, don't know why it does it). So after changing the name of executable with the normal file name via Windows' "rename" function so it wouldn't mess with the file size, I recompiled the executable and compared the file sizes. All I can say is I don't know how GM compiles, because the executable with the longer variable name was smaller than the executable with the shorter variable name. Everything else was the same.
But that doesn't change the issue: ultimately does GM store variable names in the executable (encrypted or truncated or something) and if so, would it be better to use shorter variable names? This is all "in theory", because in practice this would be a pain in the ass to actually do and would probably get confusing very quickly.
And if someone can tell me why my executables have different file sizes even when they're the exact same except for one letter, I would appreciate that too.
Edited by TheouAegis, 29 July 2012 - 04:57 PM.