blob: e85f19185544f8c19bd5912800e1382078695905 [file] [log] [blame]
Daniel Dunbar2336d1f2008-11-01 01:14:36 +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 Dunbar2336d1f2008-11-01 01:14:36 +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 Dunbar2336d1f2008-11-01 01:14:36 +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
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000022<p>This page shows the compile time performance of Clang on two
Benjamin Kramer665a8dc2012-01-15 15:26:07 +000023interesting benchmarks:</p>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +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
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000030 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 Dunbar2336d1f2008-11-01 01:14:36 +000034 <li><i>176.gcc</i>: This is the gcc-2.7.2.2 code base as present in
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000035 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 Dunbar2336d1f2008-11-01 01:14:36 +000039</ul>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000040
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000041<p>
42For previous performance numbers, please
Daniel Dunbar13e1c9d2009-06-26 18:15:47 +000043go <a href="performance-2009-03-02.html">here</a>.
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000044</p>
45
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000046<!--*************************************************************************-->
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000047<h2><a name="experiments">Experiments</a></h2>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000048<!--*************************************************************************-->
49
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000050<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
Daniel Dunbar9d284e52009-06-26 18:14:41 +000052compilers.</p>
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000053
54<p>In order to track the performance of various subsystems the timings
55have been broken down into separate stages where possible. This is
56done by over-riding the CC environment variable used during the build
57to point to one of a few simple shell scripts which may skip part of
Benjamin Kramer665a8dc2012-01-15 15:26:07 +000058the build.</p>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000059
60<ul>
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000061 <li><tt>non-compiler</tt>: The overhead of the build system itself;
62 for Sketch this also includes the time to build/copy various
63 non-source code resource files.</li>
64 <li><tt>+ driver</tt>: Add execution of the driver, but do not execute any
65 commands (by using the -### driver option).</li>
Daniel Dunbar9d284e52009-06-26 18:14:41 +000066 <li><tt>+ pch gen</tt>: Add generation of PCH files (if used).</li>
67 <li><tt>+ syntax</tt>: Add preprocessing, parsing, and semantic checking of
68 source files.</li>
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000069 <li><tt>+ IRgen</tt>: Add generation of LLVM IR (gcc has no
70 corresponding phase).</li>
71 <li><tt>+ codegen</tt>: Add generation of assembler files.</li>
72 <li><tt>+ assembler</tt>: Add assembler time to generate .o files.</li>
73 <li><tt>+ linker</tt>: Add linker time.</li>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000074</ul>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000075
Daniel Dunbar9d284e52009-06-26 18:14:41 +000076<p>This set of stages is chosen to be approximately additive, that is each
77subsequent stage simply adds some additional processing. The timings measure the
78delta of the given stage from the previous one. For example, the timings
79for <tt>+ syntax</tt> below show the difference of running with <tt>+
80syntax</tt> versus the times for <tt>+ pch gen</tt>. This amounts to a fairly
81accurate measure of only the time to perform preprocessing, parsing, and
82semantic analysis after PCH generation is done.</p>
Chris Lattner09d84ba2008-11-01 01:46:51 +000083
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000084<!--*************************************************************************-->
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000085<h2><a name="timings">Timing Results</a></h2>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000086<!--*************************************************************************-->
87
88<!--=======================================================================-->
Daniel Dunbar9d284e52009-06-26 18:14:41 +000089<h3><a name="2009-06-26">2009-06-26</a></h3>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000090<!--=======================================================================-->
91
Daniel Dunbar9d284e52009-06-26 18:14:41 +000092<a href="timing-data/2009-06-26/sketch.pdf">
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000093<img class="img_slide"
Benjamin Kramer665a8dc2012-01-15 15:26:07 +000094 src="timing-data/2009-06-26/sketch.png" alt="Sketch Timings">
Daniel Dunbar3d1c9462009-03-04 00:04:28 +000095</a>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000096
Daniel Dunbar9d284e52009-06-26 18:14:41 +000097<a href="timing-data/2009-06-26/176.gcc.pdf">
Daniel Dunbar2336d1f2008-11-01 01:14:36 +000098<img class="img_slide"
Benjamin Kramer665a8dc2012-01-15 15:26:07 +000099 src="timing-data/2009-06-26/176.gcc.png" alt="176.gcc Timings">
Daniel Dunbar3d1c9462009-03-04 00:04:28 +0000100</a>
Daniel Dunbar2336d1f2008-11-01 01:14:36 +0000101
102</div>
103</body>
104</html>