Recently I blegged (here and here) for help in designing a new machine. My goals: fast browser and JS shell builds, quietness, and a setup that wasn’t too complicated. 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 are: an Intel i7-4770 CPU (I’m using the integrated graphics), 32 GiB of RAM, a 512GB Samsung 840 Pro SSD hard disk, and a Fractal Design Define R4 case.
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.
A basic comparison
The new machine is definitely faster. Compile times are about 1.5x faster; I can do a debug browser build with clang in under 13 minutes, and one with GCC in under 17 minutes. (I hadn’t realized that clang was so much faster than GCC.)
Furthermore, disk-intensive operations are massively faster. Just as importantly, disk-intensive operations vary in speed much less. With a magnetic disk, if you’re doing something where the data is already in the disk cache, it’ll be pretty fast; otherwise it’ll be horribly slow. The SSD doesn’t suffer that dichotomy.
Finally, the new case, while not silent, is certainly quieter… maybe half as loud as the old one. It’s also bigger than I expected — it’s 1–2 inches bigger in every dimension than the old one. There must be a lot of empty space inside. And although it has a pleasingly minimalist aesthetic — it’s about as plain a black box as you could imagine — 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.
A detailed performance comparison
Building and testing
All builds are 64-bit debug builds. I used
clang 3.2-1~exp9ubuntu1 and
gcc-4.7.real (Ubuntu/Linaro 4.7.3-1ubuntu1) for compilation. I measured each operation only once, and the old machine in particular would vary in its times due to the magnetic disk. So don’t treat individual measurements as gospel. In all cases I give the old machine’s time first.
- Browser clobber build (clang): 19.7 minutes vs 12.7 minutes (1.56x faster). I didn’t measure a GCC brower build on the old machine, but on the new machine it was 16.8 minutes (1.32x slower than clang).
- Browser no-change build (clang): 48 seconds vs 31 seconds (1.55x faster).
- Browser clobber build, with ccache, with an empty cache (clang): 23.3 minutes vs 14.8 minutes (1.57x faster). These are 1.18x slower and 1.17x slower than the corresponding non-ccache builds.
- Browser clobber build, with ccache, with a full cache (clang): 6.2 minutes vs 2.6 minutes (2.4x faster). These are 3.18x faster and 4.89x faster than the corresponding non-ccache builds. Here the effect of the SSD becomes clear — the new machine gets a much bigger benefit from ccache.
- Two concurrent browser builds (clang): 45.9 & 45.4 minutes vs 22.5 & 22.5 minutes (2.03x faster). Interestingly, the amortized per-build time on the old machine (22.9 minutes) was 1.16x slower than a single build, but the amortized per-build time on the new machine (11.3 minutes) was 1.12x faster than a single build. The new machine, despite having the same number of cores, clearly provides more parallelism, and a single browser build doesn’t take full advantage of that parallelism.
- JS shell everything-but-ICU build (clang): 59 seconds vs 42 seconds (1.4x faster). It’s worth noting that JS shell builds spend a higher proportion of their time doing C++ compilation than browser builds.
- JS shell everything-but-ICU build (GCC): 130 seconds vs 81 seconds (1.60x faster). These are 2.20x slower and 1.93x slower than the corresponding clang builds!
- JS jit tests (compiled with clang): 179 seconds vs 137 seconds (1.31x faster). These tests are much more CPU-bound and less disk-bound than compilation, so the smaller speed up isn’t surprising.
- SunSpider: 156 ms vs 127 ms (1.23x faster). Again, CPU is the main factor.
Next, here are the times for some disk-intensive operations. The results here, especially for the old machine, could be highly variable.
- Delete a build directory: 10.5 seconds vs 1.4 seconds (7.5x faster).
- Do a local clone of mozilla-inbound: 7.7 minutes vs 10 seconds (46x faster).
- Recursive grep of .cpp/.h/.idl files in a repository, first time: 53.2 seconds vs 0.8 seconds (67x faster).
- The same operation, immediately again: 0.2 seconds vs 0.2 seconds (same speed).
Those last two comparisons really drive home the impact of the SSD, and the reduction in variability it provides. It’s hard to describe how pleasing this is. 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. I don’t have that any more!
And this is relevant to ccache, too. 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 — I had even more of those unpredictable pauses when doing anything other than building. This was annoying enough that I disabled it. But ccache should be much more attractive on the new machine. I will try it again soon, once I’ve had the new machine long enough that I will be well-attuned to its performance.
The CPU is a decent improvement over the old one. It accounts for roughly half the improvement in build times.
The SSD is a fantastic improvement over the old one. It too accounts for roughly half the improvement in build times, but makes disk-intensive operations much faster. It’s performance is also much less variable and thus more predictable.
clang is up to 2x faster than GCC! This surprised me greatly. I’d be interested to hear if others have seen such a large difference.
Thanks again to everybody who helped me design the new machine. It’s been well worth the effort!