Where can I change the detailed optimization settings of the C # compiler in Visual Studio?

In Visual Studio C / C ++ projects, it is easy to change the compiler optimization settings in "Property Pages | C / C ++ | Optimization". For example, we can give different levels of optimization, such as / O 2 and / O3, as well as advanced optimizations, such as Omit Frame Pointers.

However, I cannot just find the corresponding user interfaces in a C # Visual Studio project. All I can find is to simply turn off optimization: the "Optimize code" checkbox is all I have.

C # users can control detailed compiler optimizations like C / C ++? Should I provide compiler options on the command line?

alt text http://i32.tinypic.com/28ststh.png

+3
source share
3 answers

Most of the optimization of C # code continues at the JIT compiler level, not at the C # compiler. Basically, there are no such detailed settings as those available in C or C ++.

There are several performance-related runtime elements that you can customize, for example, GC strategies, but not really.

When I build test tests, etc. from the command line, I usually use something like this:

csc /o+ /debug- Test.cs

(I believe that having the appropriate pdb file matters for performance, perhaps in terms of the cost of the exceptions that were selected, therefore, the switch debug-... but I could be wrong.)

EDIT: , , , :

  • ildasm Reflector IL, ,
  • ( ilasm) ,
+8

AFAIK # . , .


http://msdn.microsoft.com/en-us/library/6s2x2bzy.aspx

:

  • /filealign .

  • /optimize / .

+4
+1
source

Source: https://habr.com/ru/post/1754178/


All Articles