<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
   <channel>
      <title>C++ Performance</title>
      <link>http://blogs.adobe.com/c++performance/</link>
      <description>Chris Cox on C++ Performance</description>
      <language>en</language>
      <copyright>Copyright 2008</copyright>
      <lastBuildDate>Sun, 20 Jul 2008 18:48:09 -0800</lastBuildDate>
      <generator>http://www.sixapart.com/movabletype/?v=3.2</generator>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs> 

            <item>
         <title>Analysis of abstraction penalty and MSVC</title>
         <description><![CDATA[<p>I've posted another analysis - this time for the stepanov abstraction penalty test compiled with MSVC 2008 and 2005.  Here we compare two releases of a single brand of compiler to look at the code generation improvements and regressions.</p>

<p><a href="http://stlab.adobe.com/wiki/index.php/Performance/Analysis/Examples">Example Analysis</a></p>]]></description>
         <link>http://blogs.adobe.com/c++performance/2008/07/analysis_of_abstraction_penalt.html</link>
         <guid>http://blogs.adobe.com/c++performance/2008/07/analysis_of_abstraction_penalt.html</guid>
         <category>analysis</category>
         <pubDate>Sun, 20 Jul 2008 18:48:09 -0800</pubDate>
      </item>
            <item>
         <title>Another Analysis Example</title>
         <description><![CDATA[<p>I've written up another analysis for loop invariant code motion and LLVM.  The good news is that the LLVM team has already fixed some of the problems identified by my code.  The bad news is that I discovered that I used the wrong code for one test (loop invariant integer division) and need to add something more suitable in a future release.<p></p>

<p><a href="http://stlab.adobe.com/wiki/index.php/Performance/Analysis/Examples">Example Analysis</a></p>]]></description>
         <link>http://blogs.adobe.com/c++performance/2008/06/post.html</link>
         <guid>http://blogs.adobe.com/c++performance/2008/06/post.html</guid>
         <category>analysis</category>
         <pubDate>Sun, 29 Jun 2008 17:26:51 -0800</pubDate>
      </item>
            <item>
         <title>Example Analysis</title>
         <description><![CDATA[<p>A few people have asked how to analyze the numbers that the benchmark code generates. Unfortunately, I don't have any automated analysis yet.  So I wrote up an example analysis of one test.
I'll post more examples as I get time.</p>

<a href="http://stlab.adobe.com/wiki/index.php/Performance/Analysis/Examples">Example Analysis</a>
  ]]></description>
         <link>http://blogs.adobe.com/c++performance/2008/05/example_analysis_1.html</link>
         <guid>http://blogs.adobe.com/c++performance/2008/05/example_analysis_1.html</guid>
         <category>analysis</category>
         <pubDate>Thu, 29 May 2008 20:52:30 -0800</pubDate>
      </item>
            <item>
         <title>Release now available</title>
         <description><![CDATA[<p>The initial release of my benchmark is available now from <A HREF="http://stlab.adobe.com/performance/">http://stlab.adobe.com/performance/</A>.</p>]]></description>
         <link>http://blogs.adobe.com/c++performance/2008/05/release_now_available.html</link>
         <guid>http://blogs.adobe.com/c++performance/2008/05/release_now_available.html</guid>
         <category>announcements</category>
         <pubDate>Tue, 13 May 2008 21:34:21 -0800</pubDate>
      </item>
            <item>
         <title>Preparing the initial release</title>
         <description><![CDATA[<p>So far, I have written about 50 test files.   I&#8217;m trying to explore the axes of my test space:  what areas need to be tested, how deeply and specifically do they need to be tested, etc.  The tests I&#8217;ve written cover C++ language concepts, simple idioms, common use idioms,  runtime support, specification conformance, and compiler optimizations.  Most of the tests have at least one major compiler performing badly.  Of course, that is probably because I&#8217;m taking the tests from lists of things that I know compilers don&#8217;t do so well.  On a positive note: all of the compilers I have tested are doing very well on dead code elimination.</p>


<p>I selected 3 of those tests to go out in the initial release &#8212; because people are more likely to read, understand, and discuss 20 pages of code than 2000.  This will also give me a chance to get some verification on the approach and style, then clean up the remaining test files before sending those out.</p>

<p><DL><DT>Stepanov Abstraction</DT><DD>An expanded version of the original test, answering &#8220;what happens to performance when I wrap a value in curly braces&#8221;?  Almost all compilers do well on the original summation tests, but they don&#8217;t do nearly so well on simple sort routines using the same abstractions.</DD></p>

<p><DT>Loop Invariant Code Motion</DT><DD>A test to see if the compiler will move loop invariant calculations out of the loop. This is something that a lot of developers assume that the compiler does for them. Unfortunately, the compilers I tested have a lot of room for improvement in this area.</DD></p>

<p><DT>Loop Unrolling</DT><DD>This is almost a straightforward test to see if compilers will correctly unroll loops to hide instruction latency. &#8220;Almost&#8221; because if I hand unrolled the loops it would be several hundred pages of source (I did it, it&#8217;s big).  So, I used templates to do the unrolling &#8212; and found that some compilers have problems with such templates (which is yet another performance bug). Every compiler I&#8217;ve tested has a long way to go on correctly unrolling loops.</DD></p>

<p><DT>Machine Info</DT><DD>Plus one utility program to print out information about the compiler version, <span class="caps">OS, </span>and machine environment - because it&#8217;s nice to know which build of your compiler generated a particular report, and which of the 30 machines in your lab that it was run on.</DD></DL></p>

<p>A few weeks ago, I sent the initial release out to select compiler vendors for review.   I received responses from 3 of the major compiler vendors, and 2 compiler teams have already found and fixed a couple of bugs based on my code (Yea!).</p>

<p>My next step is to setup a web site for downloads and send the initial release out to a larger audience of compiler writers.</p>]]></description>
         <link>http://blogs.adobe.com/c++performance/2008/05/preparing_the_initial_release_1.html</link>
         <guid>http://blogs.adobe.com/c++performance/2008/05/preparing_the_initial_release_1.html</guid>
         <category></category>
         <pubDate>Sun, 04 May 2008 22:31:33 -0800</pubDate>
      </item>
            <item>
         <title>Some Background</title>
         <description><![CDATA[<p>I joined Adobe to work on Photoshop in 1996.  Since that time, I've been working on Photoshop performance:  making sure we test it correctly, finding the problem spots in the code, tuning the code for optimal performance, researching new techniques, testing new compilers, understanding new processors, teaching my coworkers how to test and tune for performance, etc.</p>

<p>Over the years, I've collected a lot of code showing particular problems we've found, and solutions we have found.  But that code has only been shared inside Adobe or with compiler vendors with whom Adobe has a Non Disclosure Agreement (NDA).</p>

<p>Several months back, I was writing up some notes on the concept of abstraction in computer science and revisited Alex Stepanov's abstraction penalty benchmark.  Alex wrote this benchmark at a time (circa 1994) when C++ compilers weren't doing a great job of optimizing even basic C++ abstraction.  Within a few years of the benchmark's release, most compiler vendors had identified and fixed their performance problems that the benchmark exposed.</p>

<p>I wondered if the compiler writers had really done the job well or taken shortcuts, and what the penalties would be for using more complex C++ abstraction.  So, I asked Alex (who happens to work just down the hall from me) if anyone had updated his benchmark or was doing active research on it and related penalties.  Alex said "No, I don't know of anyone working on that.  Why don't you take it over?".</p>

<p>Alex then proceeded to convince me that we really need better benchmarks - ones that don't try to sum up the whole world in one number, but tests that probe specific areas and patterns.  They should answer the questions such as:  "What is the penalty for using X?" or "Does my compiler perform optimization Y?"  Alex argued that such a set of benchmarks, if released as open source (without all the NDA hassles), would benefit all of Adobe's applications by improving the compilers, and benefit all C++ users the same way.  He said that it was almost the same thing I had been doing with our internal code, but with wider exposure, and hopefully a few more people contributing.  Of course, then we had to convince my manager -- but the idea was good (and backed by several senior researchers who had joined the discussion), so she agreed that I could spend part of my time creating benchmarks.</p>

<p>Now I've got a blank slate, a lot of historical code that can't go out as-is, a long list of complaints about compilers, a longer list of suspicions about compilers, and a lot of things that I've heard other people claim or complain about C++ and compilers (much of which I know not to be true).</p>

<p>Where should I start?</p>]]></description>
         <link>http://blogs.adobe.com/c++performance/2008/03/some_background.html</link>
         <guid>http://blogs.adobe.com/c++performance/2008/03/some_background.html</guid>
         <category></category>
         <pubDate>Sun, 16 Mar 2008 14:34:17 -0800</pubDate>
      </item>
      
   </channel>
</rss>
