.NET Compiler Optimization

I am writing an application that I need to run at an incredibly low processor speed. The application creates and destroys memory in a creative style throughout its launch, and it works fine. What compiler optimizations are happening, so I can try to do this?

One trick is that the CLR processes arrays much faster than lists, so if you need to process tons of items in a list, you might be better off not calling ToArray () and processing it, rather than calling ElementAt () again and again.

+3
source share
7 answers

, , , , . Stack Overflow, Google , .

- , , .

+8

, , .

. - . .

, ... , , , , . CLR/ .

StringBuilder - : . , , - , . , .

+6

, StringBuilder . .

(+ ) StringBuilder.

Windows Forms.NET DataGridView.AutoSizeColumnsMode AutoSizeRowMode.

+2

, - ; :

  • - ? ? .. ( ) ?
  • - ? ( , DynamicMethod ..) - , Reflection.Emit?
  • unsafe? ( , , ).
  • ( , ) - IL? ( - ), , , . (, , - IL), () stloc/ldloc ( )

, , . , , , , .

+2

, , List. CLR , . , , unsafe, . , , .

+1

( ), , . , - , , , , .

, , , - , .

. " ", . , , , .

+1

(GC) GC.Collect. GC, , , GC.Collect .

For a specific GDI +, call Invalidateto nullify the client area or a specific rectangle of the control or form instead of calling Refreshthat call Invalidateand updateto redraw the control.

0
source

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


All Articles