Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
| 2 | "http://www.w3.org/TR/html4/strict.dtd"> |
| 3 | <html> |
| 4 | <head> |
| 5 | <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" /> |
| 6 | <title>Clang - Performance</title> |
| 7 | <link type="text/css" rel="stylesheet" href="menu.css" /> |
| 8 | <link type="text/css" rel="stylesheet" href="content.css" /> |
| 9 | <style type="text/css"> |
| 10 | </style> |
| 11 | </head> |
| 12 | <body> |
| 13 | |
| 14 | <!--#include virtual="menu.html.incl"--> |
| 15 | |
| 16 | <div id="content"> |
| 17 | |
| 18 | <!--*************************************************************************--> |
| 19 | <h1>Clang - Performance</h1> |
| 20 | <!--*************************************************************************--> |
| 21 | |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 22 | <p>This page shows the compile time performance of Clang on two |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 23 | interesting benchmarks: |
| 24 | <ul> |
| 25 | <li><i>Sketch</i>: The Objective-C example application shipped on |
| 26 | Mac OS X as part of Xcode. <i>Sketch</i> is indicative of a |
| 27 | "typical" Objective-C app. The source itself has a relatively |
| 28 | small amount of code (~7,500 lines of source code), but it relies |
| 29 | on the extensive Cocoa APIs to build its functionality. Like many |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 30 | Objective-C applications, it includes <tt>Cocoa/Cocoa.h</tt> in |
| 31 | all of its source files, which represents a significant stress |
| 32 | test of the front-end's performance on lexing, preprocessing, |
| 33 | parsing, and syntax analysis.</li> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 34 | <li><i>176.gcc</i>: This is the gcc-2.7.2.2 code base as present in |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 35 | SPECINT 2000. In contrast to Sketch, <i>176.gcc</i> consists of a |
| 36 | large amount of C source code (~200,000 lines) with few system |
| 37 | dependencies. This stresses the back-end's performance on generating |
| 38 | assembly code and debug information.</li> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 39 | </ul> |
| 40 | </p> |
| 41 | |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 42 | <p> |
| 43 | For previous performance numbers, please |
Daniel Dunbar | 13e1c9d | 2009-06-26 18:15:47 +0000 | [diff] [blame] | 44 | go <a href="performance-2009-03-02.html">here</a>. |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 45 | </p> |
| 46 | |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 47 | <!--*************************************************************************--> |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 48 | <h2><a name="experiments">Experiments</a></h2> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 49 | <!--*************************************************************************--> |
| 50 | |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 51 | <p>Measurements are done by running a full build (using xcodebuild or |
| 52 | make for Sketch and 176.gcc respectively) using Clang and gcc 4.2 as |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 53 | compilers.</p> |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 54 | |
| 55 | <p>In order to track the performance of various subsystems the timings |
| 56 | have been broken down into separate stages where possible. This is |
| 57 | done by over-riding the CC environment variable used during the build |
| 58 | to point to one of a few simple shell scripts which may skip part of |
| 59 | the build. |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 60 | |
| 61 | <ul> |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 62 | <li><tt>non-compiler</tt>: The overhead of the build system itself; |
| 63 | for Sketch this also includes the time to build/copy various |
| 64 | non-source code resource files.</li> |
| 65 | <li><tt>+ driver</tt>: Add execution of the driver, but do not execute any |
| 66 | commands (by using the -### driver option).</li> |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 67 | <li><tt>+ pch gen</tt>: Add generation of PCH files (if used).</li> |
| 68 | <li><tt>+ syntax</tt>: Add preprocessing, parsing, and semantic checking of |
| 69 | source files.</li> |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 70 | <li><tt>+ IRgen</tt>: Add generation of LLVM IR (gcc has no |
| 71 | corresponding phase).</li> |
| 72 | <li><tt>+ codegen</tt>: Add generation of assembler files.</li> |
| 73 | <li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li> |
| 74 | <li><tt>+ linker</tt>: Add linker time.</li> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 75 | </ul> |
| 76 | </p> |
| 77 | |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 78 | <p>This set of stages is chosen to be approximately additive, that is each |
| 79 | subsequent stage simply adds some additional processing. The timings measure the |
| 80 | delta of the given stage from the previous one. For example, the timings |
| 81 | for <tt>+ syntax</tt> below show the difference of running with <tt>+ |
| 82 | syntax</tt> versus the times for <tt>+ pch gen</tt>. This amounts to a fairly |
| 83 | accurate measure of only the time to perform preprocessing, parsing, and |
| 84 | semantic analysis after PCH generation is done.</p> |
Chris Lattner | 09d84ba | 2008-11-01 01:46:51 +0000 | [diff] [blame] | 85 | |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 86 | <!--*************************************************************************--> |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 87 | <h2><a name="timings">Timing Results</a></h2> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 88 | <!--*************************************************************************--> |
| 89 | |
| 90 | <!--=======================================================================--> |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 91 | <h3><a name="2009-06-26">2009-06-26</a></h3> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 92 | <!--=======================================================================--> |
| 93 | |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 94 | <a href="timing-data/2009-06-26/sketch.pdf"> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 95 | <img class="img_slide" |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 96 | src="timing-data/2009-06-26/sketch.png" alt="Sketch Timings"/> |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 97 | </a> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 98 | |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 99 | <a href="timing-data/2009-06-26/176.gcc.pdf"> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 100 | <img class="img_slide" |
Daniel Dunbar | 9d284e5 | 2009-06-26 18:14:41 +0000 | [diff] [blame] | 101 | src="timing-data/2009-06-26/176.gcc.png" alt="176.gcc Timings"/> |
Daniel Dunbar | 3d1c946 | 2009-03-04 00:04:28 +0000 | [diff] [blame] | 102 | </a> |
Daniel Dunbar | 2336d1f | 2008-11-01 01:14:36 +0000 | [diff] [blame] | 103 | |
| 104 | </div> |
| 105 | </body> |
| 106 | </html> |