C#. Does shortening identifier names increase overall run-time performance of an application?
Shortening identifier names makes the resulting executable smaller in size since MSIL code includes all these names except local variable ones. Does it affect executing the code in .NET runtime in a good way in terms of performance, at least in theory? Native machine code doesn't include all those names but it interoperates with .NET runtime. So I wonder if it makes sense to ob开发者_开发技巧fuscate (namely shorten identifier names) the MSIL code in order to increase the run-time performance of the application at least a little.
I was surprised by this statement: "Dotfuscator improves run-time performance. By removing unneeded program elements and renaming identifiers to small names, Dotfuscator can actually speed up programs." http://msdn.microsoft.com/en-us/library/ms227226.aspx
The identifier names get discarded by the compiler/jitter, so this will not make any difference.
The first time you run an application, the MSIL is compiled to machine code for that platform - after that the machine code is executed. So theoretically, I would think the 1st time compile MIGHT be affected, but the final machine code execution time which doesn't use those names won't change a whit after the machine compilation is done.
精彩评论