blob: 3e8c4111053634fa78c4aa461cd87e18e7291e17 [file] [log] [blame]
Daniel Dunbar9d284e52009-06-26 18:14:41 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
3<html>
4<head>
Benjamin Kramer665a8dc2012-01-15 15:26:07 +00005 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Daniel Dunbar9d284e52009-06-26 18:14:41 +00006 <title>Clang - Performance</title>
Benjamin Kramer665a8dc2012-01-15 15:26:07 +00007 <link type="text/css" rel="stylesheet" href="menu.css">
8 <link type="text/css" rel="stylesheet" href="content.css">
Daniel Dunbar9d284e52009-06-26 18:14:41 +00009 <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
22<p>This page shows the compile time performance of Clang on two
Benjamin Kramer665a8dc2012-01-15 15:26:07 +000023interesting benchmarks:</p>
Daniel Dunbar9d284e52009-06-26 18:14:41 +000024<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
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>
34 <li><i>176.gcc</i>: This is the gcc-2.7.2.2 code base as present in
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>
39</ul>
Daniel Dunbar9d284e52009-06-26 18:14:41 +000040
41<p>
42For previous performance numbers, please
43go <a href="performance-2008-10-31.html">here</a>.
44</p>
45
46<!--*************************************************************************-->
47<h2><a name="experiments">Experiments</a></h2>
48<!--*************************************************************************-->
49
50<p>Measurements are done by running a full build (using xcodebuild or
51make for Sketch and 176.gcc respectively) using Clang and gcc 4.2 as
52compilers; gcc is run both with and without the new clang driver (ccc)
53in order to evaluate the overhead of the driver itself.</p>
54
55<p>In order to track the performance of various subsystems the timings
56have been broken down into separate stages where possible. This is
57done by over-riding the CC environment variable used during the build
58to point to one of a few simple shell scripts which may skip part of
Benjamin Kramer665a8dc2012-01-15 15:26:07 +000059the build.</p>
Daniel Dunbar9d284e52009-06-26 18:14:41 +000060
61<ul>
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>
67 <li><tt>+ pch gen</tt>: Add generation of PCH files.</li>
68 <li><tt>+ cpp</tt>: Add preprocessing of source files (this time is
69 include in syntax for gcc).</li>
70 <li><tt>+ parse</tt>: Add parsing of source files (this time is
71 include in syntax for gcc).</li>
72 <li><tt>+ syntax</tt>: Add semantic checking of source files (for
73 gcc, this includes preprocessing and parsing as well).</li>
74 <li><tt>+ IRgen</tt>: Add generation of LLVM IR (gcc has no
75 corresponding phase).</li>
76 <li><tt>+ codegen</tt>: Add generation of assembler files.</li>
77 <li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li>
78 <li><tt>+ linker</tt>: Add linker time.</li>
79</ul>
Daniel Dunbar9d284e52009-06-26 18:14:41 +000080
81<p>This set of stages is chosen to be approximately additive, that is
82each subsequent stage simply adds some additional processing. The
83timings measure the delta of the given stage from the previous
84one. For example, the timings for <tt>+ syntax</tt> below show the
85difference of running with <tt>+ syntax</tt> versus running with <tt>+
86parse</tt> (for clang) or <tt>+ driver</tt> with gcc. This amounts to
87a fairly accurate measure of only the time to perform semantic
88analysis (and preprocessing/parsing, in the case of gcc).</p>
89
90<!--*************************************************************************-->
91<h2><a name="timings">Timing Results</a></h2>
92<!--*************************************************************************-->
93
94<!--=======================================================================-->
95<h3><a name="2009-03-02">2009-03-02</a></h3>
96<!--=======================================================================-->
97
98<a href="timing-data/2009-03-02/sketch.pdf">
99<img class="img_slide"
Benjamin Kramer665a8dc2012-01-15 15:26:07 +0000100 src="timing-data/2009-03-02/sketch.png" alt="Sketch Timings">
Daniel Dunbar9d284e52009-06-26 18:14:41 +0000101</a>
102
103<a href="timing-data/2009-03-02/176.gcc.pdf">
104<img class="img_slide"
Benjamin Kramer665a8dc2012-01-15 15:26:07 +0000105 src="timing-data/2009-03-02/176.gcc.png" alt="176.gcc Timings">
Daniel Dunbar9d284e52009-06-26 18:14:41 +0000106</a>
107
108</div>
109</body>
110</html>