<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Perf penalty Static Constructor</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx</link><description>There was a thread recently over the CLR perf alias that I thought I&amp;#8217;d share. One of the WinFX developers asks if there is any perf differences between these two classes: public class Foo1 { public static int Value = 42; } public class Foo2 { static</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Perf penalty Static Constructor</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#115359</link><pubDate>Sun, 18 Apr 2004 01:40:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:115359</guid><dc:creator>Justin Rogers</dc:creator><description>Seems like a possible compiler optimization as well since it blits the same IL, it should be able to identify this and blit the field marking.</description></item><item><title>re: Perf penalty Static Constructor</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#116106</link><pubDate>Mon, 19 Apr 2004 18:07:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:116106</guid><dc:creator>Kevin Westhead</dc:creator><description>Wouldn't it be better to allow explicit declaration of beforefieldinit? E.g.&lt;br&gt;&lt;br&gt;[BeforeFieldInit()]&lt;br&gt;public class Foo1&lt;br&gt;{ ... }&lt;br&gt;&lt;br&gt;This way I could get the advantages of beforefieldinit and still explicitly initialise my static members in the static ctor. In otherwords, it seems logical to expect intialisation to occur in a ctor, with additional behaviours produced via attributes. I would find this preferable to writing the following:&lt;br&gt;&lt;br&gt;public class Foo1&lt;br&gt;{&lt;br&gt;  static int s_first = InitializeStaticMembers();&lt;br&gt;&lt;br&gt;  static int InitializeStaticMembers()&lt;br&gt;  {&lt;br&gt;    s_second = 2;&lt;br&gt;    s_third = 3;&lt;br&gt;    // etc. for all other static members.&lt;br&gt;    return 1;&lt;br&gt;  }&lt;br&gt;&lt;br&gt;}&lt;br&gt;</description></item><item><title>Quiz: Type Constructors (Answer)</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#215510</link><pubDate>Tue, 17 Aug 2004 07:21:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:215510</guid><dc:creator>Brad Abrams </dc:creator><description /></item><item><title>FxCop :: Do not declare explicit static constructors. Ignoreable?</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#215636</link><pubDate>Tue, 17 Aug 2004 14:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:215636</guid><dc:creator>Andrew Stevenson's WebLog</dc:creator><description /></item><item><title>Dottore in dotcctor :-)</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#221670</link><pubDate>Fri, 27 Aug 2004 22:17:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:221670</guid><dc:creator>Web Log di Adrian Florea</dc:creator><description /></item><item><title>Static Constructors </title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#229762</link><pubDate>Wed, 15 Sep 2004 07:12:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:229762</guid><dc:creator>K. Scott Allen's Blog</dc:creator><description /></item><item><title>Static Constructors </title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#229763</link><pubDate>Wed, 15 Sep 2004 07:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:229763</guid><dc:creator>K. Scott Allen's Blog</dc:creator><description /></item><item><title>Singleton</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#466019</link><pubDate>Wed, 14 Sep 2005 15:56:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:466019</guid><dc:creator>FoxyBlog</dc:creator><description /></item><item><title>Singleton</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#466027</link><pubDate>Wed, 14 Sep 2005 16:22:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:466027</guid><dc:creator>FoxyBlog</dc:creator><description /></item><item><title>Singleton</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#466038</link><pubDate>Wed, 14 Sep 2005 16:43:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:466038</guid><dc:creator>FoxyBlog</dc:creator><description /></item><item><title>Singleton</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#466039</link><pubDate>Wed, 14 Sep 2005 16:45:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:466039</guid><dc:creator>FoxyBlog</dc:creator><description /></item><item><title>Singleton</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#466040</link><pubDate>Wed, 14 Sep 2005 16:45:51 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:466040</guid><dc:creator>FoxyBlog</dc:creator><description /></item><item><title>Web Client Software Factory and Static Constructors</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#778812</link><pubDate>Sun, 01 Oct 2006 03:36:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:778812</guid><dc:creator>David Hayden [MVP C#]</dc:creator><description>The Microsoft Patterns and Practices Group had a drop of the Web Client Software Factory , so I thought</description></item><item><title>Tudor Vlad&amp;#8217;s Blog &amp;raquo; Static constructors: populating static collections </title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#4446197</link><pubDate>Sat, 18 Aug 2007 15:19:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:4446197</guid><dc:creator>Tudor Vlad’s Blog » Static constructors: populating static collections </dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.tudorvlad.ro/2007/08/18/static-constructors-populating-static-collections/"&gt;http://www.tudorvlad.ro/2007/08/18/static-constructors-populating-static-collections/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>First experiences with WPF</title><link>http://blogs.msdn.com/brada/archive/2004/04/17/115300.aspx#9425065</link><pubDate>Mon, 16 Feb 2009 03:10:41 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9425065</guid><dc:creator>Nick's Blog</dc:creator><description>&lt;p&gt;To those who work with me, it may seem odd to see me to put up an entry implying that I've written &amp;quot;my first WPF&amp;quot; in recent days. But before this, my work with WPF has been very over-the-shoulder observer and any commentary (and guidance sometimes) has&lt;/p&gt;
</description></item></channel></rss>