c# static constructor?



I have done some research on this issue, but still quite puzzled.
I read one article that says static constructor can be a big performance
hit, it even gives some code fragment, which, accoring to that article,
could show a big difference betweeen using static constructor or not. But
when I run his code, I found no significant diifference at all.
For this reason, I even checked the assemly code of using static
constructor, and I can not find any thing that will cause performornce
degradation.
Or course, lazy initialization is good, but not all cases really care that
much about startup time, so I doubt if the performance issue of static
constructor is exagerated.

Could someone shed some light on this?



.



Relevant Pages

  • Re: c# static constructor?
    ... ms news group wrote: ... I read one article that says static constructor can be a big performance ... hit, it even gives some code fragment, which, accoring to that article, ... you have a very tight loop which just calls a cheap static method ...
    (microsoft.public.dotnet.framework.performance)
  • c# static constructor?
    ... I read one article that says static constructor can be a big performance ... hit, it even gives some code fragment, which, accoring to that article, ... degradation. ... Or course, lazy initialization is good, but not all cases really care that ...
    (microsoft.public.dotnet.framework.performance)

Loading