{"id":2670,"date":"2013-09-12T16:22:14","date_gmt":"2013-09-12T05:22:14","guid":{"rendered":"http:\/\/blog.mozilla.org\/nnethercote\/?p=2670"},"modified":"2013-09-12T16:45:46","modified_gmt":"2013-09-12T05:45:46","slug":"bleg-for-a-new-machine-2","status":"publish","type":"post","link":"https:\/\/blog.mozilla.org\/nnethercote\/2013\/09\/12\/bleg-for-a-new-machine-2\/","title":{"rendered":"Bleg for a new machine: outcome"},"content":{"rendered":"<p>Recently I blegged (<a href=\"https:\/\/blog.mozilla.org\/nnethercote\/2013\/08\/30\/bleg-for-a-new-machine\/\">here<\/a> and <a href=\"https:\/\/blog.mozilla.org\/nnethercote\/2013\/09\/02\/bleg-for-a-new-machine-part-2\/\">here<\/a>) for help in designing a new machine.\u00a0 My goals:\u00a0 fast browser and JS shell builds, quietness, and a setup that wasn&#8217;t too complicated.\u00a0 I now have the new machine and have done some comparisons to the old machine.<\/p>\n<h3>New vs old<\/h3>\n<p>The most important components of the new machine are:\u00a0 an Intel i7-4770 CPU (I&#8217;m using the integrated graphics), 32 GiB of RAM, a 512GB Samsung 840 Pro SSD hard disk, and a Fractal Design Define R4 case.<\/p>\n<p>In comparison, the equivalent components in the old machine were: an Intel i7-2600 CPU, 16 GiB of RAM, a magnetic hard disk, and an Antec Sonata III 500 case.<\/p>\n<h3>A basic comparison<\/h3>\n<p>The new machine is definitely faster.\u00a0 Compile times are about 1.5x faster;\u00a0 I can do a debug browser build with clang in under 13 minutes, and one with GCC in under 17 minutes.\u00a0 (I hadn&#8217;t realized that clang was so much faster than GCC.)<\/p>\n<p>Furthermore, disk-intensive operations are massively faster.\u00a0 Just as importantly, disk-intensive operations vary in speed much less.\u00a0 With a magnetic disk, if you&#8217;re doing something where the data is already in the disk cache, it&#8217;ll be pretty fast;\u00a0 otherwise it&#8217;ll be horribly slow.\u00a0 The SSD doesn&#8217;t suffer that dichotomy.<\/p>\n<p>Finally, the new case, while not silent, is certainly quieter&#8230; maybe half as loud as the old one.\u00a0 It&#8217;s also<em><\/em> bigger than I expected &#8212; it&#8217;s 1&#8211;2 inches bigger in every dimension than the old one. There must be a lot of empty space inside.\u00a0 And although it has a pleasingly minimalist aesthetic &#8212; it&#8217;s about as plain a black box as you could imagine &#8212; it does have an obnoxiously bright, blue power indicator light at the top of the front panel, which I quickly covered with a small strip of black electrical tape.<\/p>\n<h3>A detailed performance comparison<\/h3>\n<h4>Building and testing<\/h4>\n<p>All builds are 64-bit debug builds.\u00a0 I used <code>clang 3.2-1~exp9ubuntu1<\/code> and <code>gcc-4.7.real (Ubuntu\/Linaro 4.7.3-1ubuntu1)<\/code> for compilation. I measured each operation only once, and the old machine in particular would vary in its times due to the magnetic disk.\u00a0 So don&#8217;t treat individual measurements as gospel.\u00a0 In all cases I give the old machine&#8217;s time first.<\/p>\n<ul>\n<li>Browser clobber build (clang): <strong>19.7 minutes<\/strong> vs <strong>12.7 minutes<\/strong> (<strong>1.56x faster<\/strong>).\u00a0 I didn&#8217;t measure a GCC brower build on the old machine, but on the new machine it was <strong>16.8 minutes<\/strong> (<strong>1.32x slower<\/strong> than clang).<\/li>\n<li>Browser no-change build (clang): <strong>48 seconds<\/strong> vs <strong>31 seconds<\/strong> (<strong>1.55x faster<\/strong>).<\/li>\n<li>Browser clobber build, with ccache, with an empty cache (clang): <strong>23.3 minutes<\/strong> vs <strong>14.8 minutes<\/strong> (<strong>1.57x faster<\/strong>).\u00a0 These are <strong>1.18x slower<\/strong> and <strong>1.17x slower<\/strong> than the corresponding non-ccache builds.<\/li>\n<li>Browser clobber build, with ccache, with a full cache (clang): <strong>6.2 minutes<\/strong> vs <strong>2.6 minutes<\/strong> (<strong>2.4x faster<\/strong>).\u00a0 These are <strong>3.18x faster<\/strong> and <strong>4.89x faster<\/strong> than the corresponding non-ccache builds.\u00a0 Here the effect of the SSD becomes clear &#8212; the new machine gets a much bigger benefit from ccache.<\/li>\n<li>Two concurrent browser builds (clang): <strong>45.9 &amp; 45.4 minutes<\/strong> vs <strong>22.5 &amp; 22.5 minutes<\/strong> (<strong>2.03x faster<\/strong>).\u00a0 Interestingly, the amortized per-build time on the old machine (<strong>22.9 minutes<\/strong>) was <strong>1.16x <em>slower<\/em><\/strong> than a single build, but the amortized per-build time on the new machine (<strong>11.3 minutes<\/strong>) was <strong>1.12x <em>faster<\/em><\/strong> than a single build.\u00a0 The new machine, despite having the same number of cores, clearly provides more parallelism, and a single browser build doesn&#8217;t take full advantage of that parallelism.<\/li>\n<li>JS shell everything-but-ICU build (clang): <strong>59 seconds<\/strong> vs <strong>42 seconds<\/strong> (<strong>1.4x faster<\/strong>).\u00a0 It&#8217;s worth noting that JS shell builds spend a higher proportion of their time doing C++ compilation than browser builds.<\/li>\n<li>JS shell everything-but-ICU build (GCC): <strong>130 seconds<\/strong> vs <strong>81 seconds<\/strong> (<strong>1.60x faster<\/strong>).\u00a0 These are <strong>2.20x slower<\/strong> and <strong>1.93x slower<\/strong> than the corresponding clang builds!<\/li>\n<li>JS jit tests (compiled with clang): <strong>179 seconds<\/strong> vs <strong>137 seconds<\/strong> (<strong>1.31x faster<\/strong>).\u00a0 These tests are much more CPU-bound and less disk-bound than compilation, so the smaller speed up isn&#8217;t surprising.<\/li>\n<li>SunSpider: <strong>156 ms<\/strong> vs <strong>127 ms<\/strong> (<strong>1.23x faster<\/strong>).\u00a0 Again, CPU is the main factor.<\/li>\n<\/ul>\n<p>Next, here are the times for some disk-intensive operations.\u00a0 The results here, especially for the old machine, could be highly variable.<\/p>\n<ul>\n<li>Delete a build directory: <strong>10.5 seconds<\/strong> vs <strong>1.4 seconds<\/strong> (<strong>7.5x faster<\/strong>).<\/li>\n<li>Do a local clone of mozilla-inbound: <strong>7.7 minutes<\/strong> vs<strong> 10 seconds<\/strong> (<strong>46x faster<\/strong>).<\/li>\n<li>Recursive grep of .cpp\/.h\/.idl files in a repository, first time: <strong>53.2 seconds<\/strong> vs <strong>0.8 seconds<\/strong> (<strong>67x faster<\/strong>).<\/li>\n<li>The same operation, immediately again: <strong>0.2 seconds<\/strong> vs <strong>0.2 seconds<\/strong> (<strong>same speed<\/strong>).<\/li>\n<\/ul>\n<p>Those last two comparisons really drive home the impact of the SSD, and the reduction in variability it provides. It&#8217;s hard to describe how pleasing this is.\u00a0 On the old machine I always knew when libxul.so was linking, because my whole machine would grind to a halt and trivial operations like saving a file in vim would take multiple seconds.\u00a0 I don&#8217;t have that any more!<\/p>\n<p>And this is relevant to ccache, too.\u00a0 I tried ccache again recently on my old machine, and while it did speed up compilations somewhat, the extra load on the disk noticeably affected everything else &#8212; I had even more of those unpredictable pauses when doing anything other than building.\u00a0 This was annoying enough that I disabled it.\u00a0 But ccache should be much more attractive on the new machine.\u00a0 I will try it again soon, once I&#8217;ve had the new machine long enough that I will be well-attuned to its performance.<\/p>\n<h4>Conclusion<\/h4>\n<p>The CPU is a decent improvement over the old one.\u00a0 It accounts for roughly half the improvement in build times.<\/p>\n<p>The SSD is a fantastic improvement over the old one.\u00a0 It too accounts for roughly half the improvement in build times, but makes disk-intensive operations <em>much<\/em> faster.\u00a0 It&#8217;s performance is also much less variable and thus more predictable.<\/p>\n<p>clang is up to 2x faster than GCC!\u00a0 This surprised me greatly.\u00a0 I&#8217;d be interested to hear if others have seen such a large difference.<\/p>\n<p>Thanks again to everybody who helped me design the new machine.\u00a0 It&#8217;s been well worth the effort!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I blegged (here and here) for help in designing a new machine.\u00a0 My goals:\u00a0 fast browser and JS shell builds, quietness, and a setup that wasn&#8217;t too complicated.\u00a0 I now have the new machine and have done some comparisons to the old machine. New vs old The most important components of the new machine [&hellip;]<\/p>\n","protected":false},"author":139,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2670"}],"collection":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/users\/139"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/comments?post=2670"}],"version-history":[{"count":0,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/posts\/2670\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/media?parent=2670"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/categories?post=2670"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mozilla.org\/nnethercote\/wp-json\/wp\/v2\/tags?post=2670"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}