Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What attributes help runtime .Net performance?

I am looking for attributes I can use to ensure the best runtime performance for my .Net application by giving hints to the loader, JIT compiler or ngen.

For example we have DebuggableAttribute which should be set to not debug and not disable optimization for optimal performance.

[Debuggable(false, false)]

Are there any others I should know about?

like image 911
Lars Truijens Avatar asked Sep 16 '08 07:09

Lars Truijens


1 Answers

Ecma-335 specifies some more CompilationRelaxations for relaxed exception handling (so-called e-relaxed calls) in Annex F "Imprecise faults", but they have not been exposed by Microsoft.

Specifically CompilationRelaxations.RelaxedArrayExceptions and CompilationRelaxations.RelaxedNullReferenceException are mentioned there.

It'd be intersting what happens when you just try some integers in the CompilationRelaxationsAttribute's ctor ;)

like image 52
Thomas Danecker Avatar answered Sep 19 '22 18:09

Thomas Danecker