<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Code Optimization: Go For the Jugular</title>
	<atom:link href="http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/feed/" rel="self" type="application/rss+xml" />
	<link>http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/</link>
	<description>SamplingProfiler, DWS and other Delphi tools</description>
	<lastBuildDate>Fri, 03 Feb 2012 09:15:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Doug</title>
		<link>http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/comment-page-1/#comment-1240</link>
		<dc:creator>Doug</dc:creator>
		<pubDate>Tue, 24 Aug 2010 19:22:00 +0000</pubDate>
		<guid isPermaLink="false">http://delphitools.info/?p=343#comment-1240</guid>
		<description>Yes, great educational article, thank you Eric.

But interestingly I tested this same procedure under Delphi 7 as an exercise to become familiar with SamplingProfiler, and in my tests the exception frame overheads were insignificant.

The time spent on the &quot;end&quot; statement in DoSomething1 varies between 0 and 11%.

I tested with array sizes from 40,000,000 to 200,000,000 integers, with the following typical number of samples for each array size:

Array size:   40M  80M  200M
DoSomething1  105  212  544
DoSomething4  104  211  539

So it seems to me that with Delphi 7 it&#039;s not worth the disadvantages of moving the exception to a procedure.

Or am I missing something?  (The &quot;stack setup&quot; line did not appear in any of my profiling, nor did the &quot;case of&quot; line for DoSomething4).</description>
		<content:encoded><![CDATA[<p>Yes, great educational article, thank you Eric.</p>
<p>But interestingly I tested this same procedure under Delphi 7 as an exercise to become familiar with SamplingProfiler, and in my tests the exception frame overheads were insignificant.</p>
<p>The time spent on the &#8220;end&#8221; statement in DoSomething1 varies between 0 and 11%.</p>
<p>I tested with array sizes from 40,000,000 to 200,000,000 integers, with the following typical number of samples for each array size:</p>
<p>Array size:   40M  80M  200M<br />
DoSomething1  105  212  544<br />
DoSomething4  104  211  539</p>
<p>So it seems to me that with Delphi 7 it&#8217;s not worth the disadvantages of moving the exception to a procedure.</p>
<p>Or am I missing something?  (The &#8220;stack setup&#8221; line did not appear in any of my profiling, nor did the &#8220;case of&#8221; line for DoSomething4).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ian Boyd</title>
		<link>http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/comment-page-1/#comment-678</link>
		<dc:creator>Ian Boyd</dc:creator>
		<pubDate>Sun, 11 Apr 2010 20:49:20 +0000</pubDate>
		<guid isPermaLink="false">http://delphitools.info/?p=343#comment-678</guid>
		<description>i think this is one of the most helpful technical articles, on any subject, that i&#039;ve ever seen. It starts with a real example, and it deals with the real questions that result. And what&#039;s good is that you actually focus on the weird stuff, explain why it is, and how to fix it - or why it should not be fixed.

By dealing with the tough questions, in the same way that they would occur to another developer, you make the task of optimizing seem obvious and natural. 

Actually saying that a CreateFmt would be the first fix, but then explaining why it won&#039;t help in this case, is perfect.</description>
		<content:encoded><![CDATA[<p>i think this is one of the most helpful technical articles, on any subject, that i&#8217;ve ever seen. It starts with a real example, and it deals with the real questions that result. And what&#8217;s good is that you actually focus on the weird stuff, explain why it is, and how to fix it &#8211; or why it should not be fixed.</p>
<p>By dealing with the tough questions, in the same way that they would occur to another developer, you make the task of optimizing seem obvious and natural. </p>
<p>Actually saying that a CreateFmt would be the first fix, but then explaining why it won&#8217;t help in this case, is perfect.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dimitrij</title>
		<link>http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/comment-page-1/#comment-132</link>
		<dc:creator>Dimitrij</dc:creator>
		<pubDate>Thu, 07 May 2009 07:37:34 +0000</pubDate>
		<guid isPermaLink="false">http://delphitools.info/?p=343#comment-132</guid>
		<description>Good work mate! Thank you for this very educational example.</description>
		<content:encoded><![CDATA[<p>Good work mate! Thank you for this very educational example.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Struan</title>
		<link>http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/comment-page-1/#comment-126</link>
		<dc:creator>Struan</dc:creator>
		<pubDate>Wed, 06 May 2009 22:13:08 +0000</pubDate>
		<guid isPermaLink="false">http://delphitools.info/?p=343#comment-126</guid>
		<description>&gt; the compiler won’t “know” about the exception in the called procedure

The approach I&#039;d have taken would have been to have a utility function that returns the Exception to be raised.

ie: line 105 to read
     raise CreateUnsupportedException(what)

and defined as 
   function CreateUnsupportedException(what : TDoWhat): Exception;
   begin
      Result := Exception.Create(&#039;Unsupported: &#039;+GetEnumName(TypeInfo(TDoWhat), Integer(what)));
   end;


Wouldn&#039;t that still remove the Sting cleanup code into the function but also allow the compiler to &quot;see&quot; the raise.</description>
		<content:encoded><![CDATA[<p>&gt; the compiler won’t “know” about the exception in the called procedure</p>
<p>The approach I&#8217;d have taken would have been to have a utility function that returns the Exception to be raised.</p>
<p>ie: line 105 to read<br />
     raise CreateUnsupportedException(what)</p>
<p>and defined as<br />
   function CreateUnsupportedException(what : TDoWhat): Exception;<br />
   begin<br />
      Result := Exception.Create(&#8216;Unsupported: &#8216;+GetEnumName(TypeInfo(TDoWhat), Integer(what)));<br />
   end;</p>
<p>Wouldn&#8217;t that still remove the Sting cleanup code into the function but also allow the compiler to &#8220;see&#8221; the raise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: VilleK</title>
		<link>http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/comment-page-1/#comment-124</link>
		<dc:creator>VilleK</dc:creator>
		<pubDate>Wed, 06 May 2009 10:43:56 +0000</pubDate>
		<guid isPermaLink="false">http://delphitools.info/?p=343#comment-124</guid>
		<description>Good article! This reminds me I need to try your SamplingProfiler on some of my code, hopefully I will help me remove some bottlenecks.</description>
		<content:encoded><![CDATA[<p>Good article! This reminds me I need to try your SamplingProfiler on some of my code, hopefully I will help me remove some bottlenecks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Hausladen</title>
		<link>http://delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/comment-page-1/#comment-123</link>
		<dc:creator>Andreas Hausladen</dc:creator>
		<pubDate>Wed, 06 May 2009 10:21:06 +0000</pubDate>
		<guid isPermaLink="false">http://delphitools.info/?p=343#comment-123</guid>
		<description>&gt; the compiler won’t “know” about the exception in the called procedure

That&#039;s something that I really miss in Delphi. You can&#039;t give the compiler a hint that a procedure never returns. C++0x has something for this but Delphi doesn&#039;t. Maybe somebody should file a feature request in QC.</description>
		<content:encoded><![CDATA[<p>&gt; the compiler won’t “know” about the exception in the called procedure</p>
<p>That&#8217;s something that I really miss in Delphi. You can&#8217;t give the compiler a hint that a procedure never returns. C++0x has something for this but Delphi doesn&#8217;t. Maybe somebody should file a feature request in QC.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
<!-- This Quick Cache file was built for (  www.delphitools.info/2009/05/06/code-optimization-go-for-the-jugular/feed/ ) in 0.73324 seconds, on Feb 4th, 2012 at 2:36 pm UTC. -->
<!-- This Quick Cache file will automatically expire ( and be re-built automatically ) on Feb 5th, 2012 at 2:36 pm UTC -->
