<?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>Inline those vector constructors</title><link>http://blogs.msdn.com/shawnhar/archive/2007/01/02/inline-those-vector-constructors.aspx</link><description>Reading Chris To's article about Xbox CLR performance (see my previous post) reminded me of a subtle optimization for constructing new vector instances. Given some code like: DoCoolStuffWithVector( new Vector3(23, 42, -1)); You can rewrite this to avoid</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Inline those vector constructors</title><link>http://blogs.msdn.com/shawnhar/archive/2007/01/02/inline-those-vector-constructors.aspx#1402492</link><pubDate>Wed, 03 Jan 2007 11:39:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1402492</guid><dc:creator>zproxy</dc:creator><description>&lt;p&gt;This is correct, but with orcas release you will be able to write this:&lt;/p&gt;
&lt;p&gt;DoCoolStuffWithVector(new Vector3 {&lt;/p&gt;
&lt;p&gt; &amp;nbsp;X = 23, &lt;/p&gt;
&lt;p&gt; &amp;nbsp;Y = 42,&lt;/p&gt;
&lt;p&gt; &amp;nbsp;Z = -1 }&lt;/p&gt;
&lt;p&gt;);&lt;/p&gt;
&lt;p&gt;And this will compile exactly like the second example.&lt;/p&gt;
&lt;p&gt;cheers&lt;/p&gt;
</description></item><item><title>re: Inline those vector constructors</title><link>http://blogs.msdn.com/shawnhar/archive/2007/01/02/inline-those-vector-constructors.aspx#1645007</link><pubDate>Sat, 10 Feb 2007 21:03:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1645007</guid><dc:creator>robburke</dc:creator><description>&lt;p&gt;Yeouch! &amp;nbsp;That's painful and I will heed your warning.&lt;/p&gt;
&lt;p&gt;Will the Orcas change optimize code built for the Compact Framework too?&lt;/p&gt;
&lt;p&gt;It just felt like someone walked over my grave, but that shudder I just experienced came from the thought of coercing XNA Studio to run on today's Orcas bits...&lt;/p&gt;
</description></item><item><title>re: Inline those vector constructors</title><link>http://blogs.msdn.com/shawnhar/archive/2007/01/02/inline-those-vector-constructors.aspx#9901229</link><pubDate>Wed, 30 Sep 2009 12:50:02 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9901229</guid><dc:creator>Lewis Cowles</dc:creator><description>&lt;p&gt;how much of a performance boost can we expect from this code in terms of changing something that executes currently 33,000,000 times per second, would it be a large performance boost, its a few functions that are called for every object I construct and also are used for collision detection&lt;/p&gt;</description></item><item><title>re: Inline those vector constructors</title><link>http://blogs.msdn.com/shawnhar/archive/2007/01/02/inline-those-vector-constructors.aspx#9901430</link><pubDate>Wed, 30 Sep 2009 20:57:03 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9901430</guid><dc:creator>ShawnHargreaves</dc:creator><description>&lt;p&gt;&amp;gt; how much of a performance boost can we expect from this code&lt;/p&gt;
&lt;p&gt;That entirely depends on the context. Every app is different, and the only way to find out for sure where your bottlenecks are is to profile your specific game and see where it is spending its time, then optimize those particular areas.&lt;/p&gt;
&lt;p&gt;It's not possible to give generalized advice like &amp;quot;this particular optimization trick will save you X% of time&amp;quot;, because this all depends on how long the thing you just optimized was taking in the first place!&lt;/p&gt;
</description></item></channel></rss>