Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 obfuscate (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

like image 260
Andrei Sedoi Avatar asked Jul 13 '11 12:07

Andrei Sedoi


1 Answers

The identifier names get discarded by the compiler/jitter, so this will not make any difference.

like image 63
Oded Avatar answered Sep 30 '22 00:09

Oded