<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>webcodr</title>
    <link>https://webcodr.io/series/apple-silicon/</link>
    <description>Recent content on webcodr</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Thu, 21 Jan 2021 20:39:53 +0000</lastBuildDate>
    <atom:link href="https://webcodr.io/series/apple-silicon/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>Real-world performance of the Apple M1 in software development</title>
      <link>https://webcodr.io/2021/01/real-world-performance-of-the-apple-m1-in-software-development/</link>
      <pubDate>Thu, 21 Jan 2021 20:39:53 +0000</pubDate>
      <guid>https://webcodr.io/2021/01/real-world-performance-of-the-apple-m1-in-software-development/</guid>
      <description>There are enough videos on YouTube out there to show how awesome the new Macs are, but I want to share my perspective as a software developer.
About six weeks ago, I was too hyped not to buy an ARM-based Mac, so I ordered a basic MacBook Air with 8 GB RAM (16 GB was hard to get at this time). As strange as it sounds, I don’t regret buying only 8 GB of RAM. On an Intel-based Mac this would be an absolute pain in the ass, even my old 15” MacBook Pro Late 2017 with 16 GB struggles sometimes with RAM usage.
</description>
      <content:encoded><![CDATA[<p>There are enough videos on YouTube out there to show how awesome the new Macs are, but I want to share my perspective as a software developer.</p>
<p>About six weeks ago, I was too hyped not to buy an ARM-based Mac, so I ordered a basic MacBook Air with 8 GB RAM (16 GB was hard to get at this time). As strange as it sounds, I don’t regret buying only 8 GB of RAM. On an Intel-based Mac this would be an absolute pain in the ass, even my old 15” MacBook Pro Late 2017 with 16 GB struggles sometimes with RAM usage.</p>
<p>It’s really amazing how good this small, passively cooled MacBook Air is keeping up. In many scenarios it even surpasses my MacBook Pro with ease. I never had an Intel-based MacBook Air, but the last time I used a dual-core CPU for development was not pretty and that was a pretty decent i5 and not an ultra-low voltage i3.</p>
<h2 id="speed-speed-speed"><a href="#speed-speed-speed" class="heading-anchor">Speed, Speed, Speed</a></h2>
<p>Unfortunately I couldn’t really develop software on the MacBook Air for a while, since Java and IntelliJ were not available for aarch64-based Macs. Of course I tried Rosetta 2, but at least for these two, it’s quite slow. NodeJS on the other hand is incredibly fast.</p>
<p>All this changed after my Christmas vacation. IntelliJ was updated and thankfully Azul released a JDK 8 for ARM-Macs. A native version of Visual Studio Code is also available and quite fast.</p>
<p>So, no more introductions, here are some real-world scenarios and numbers.</p>
<p>I currently work on a Java project with a steadily growing codebase of Kotlin. It’s a little special, since another part of the application is written in Ruby. We’re using JRuby, so it’s bundled all together with a Vue-based frontend in a WAR-File with Maven.</p>
<h3 id="maven-build-times"><a href="#maven-build-times" class="heading-anchor">Maven Build Times</a></h3>
<p>All build times are from fully cached dependencies, so there are no interferences from my internet connection.</p>
<p>Used devices:</p>
<ul>
<li>15” MacBook Pro Late 2017: Intel Core-i7 7700HQ, 16 GB RAM</li>
<li>13” MacBook Air Late 2020: Apple M1, 8 GB RAM</li>
<li>PC: AMD Ryzen 9 3950X, 32 GB RAM</li>
</ul>
<table>
	<thead>
			<tr>
					<th>Device</th>
					<th>Build time with tests</th>
					<th>Build time without tests</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>MacBook Pro</td>
					<td>223 s</td>
					<td>183 s</td>
			</tr>
			<tr>
					<td>MacBook Air</td>
					<td>85 s</td>
					<td>63 s</td>
			</tr>
			<tr>
					<td>PC</td>
					<td>84 s</td>
					<td>66 s</td>
			</tr>
	</tbody>
</table>
<p>Well, a small, passively cooled MacBook Air is as fast as a full-blown and custom water-cooled 16-core monster of a PC. The MacBook Pro gets utterly destroyed. To get this straight: the cheapest notebook Apple makes, destroys a MacBook Pro that costs more than twice as much.</p>
<h3 id="ruby-unit-test-times"><a href="#ruby-unit-test-times" class="heading-anchor">Ruby Unit Test Times</a></h3>
<p>The test suite contains 1,087 examples. Please keep in mind, that I had to use Rosetta 2 in order to get everything running on the MacBook Air, since not all used Ruby Gems are compatible with ARM at this time. All tests were run with Ruby 2.7.1.</p>
<table>
	<thead>
			<tr>
					<th>Device</th>
					<th>Test duration</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>MacBook Pro native</td>
					<td>1.9 s</td>
			</tr>
			<tr>
					<td>MacBook Air with Rosetta 2</td>
					<td>1.1 s</td>
			</tr>
			<tr>
					<td>PC native</td>
					<td>1.3 s</td>
			</tr>
	</tbody>
</table>
<p>Yeah, it’s quite fast, compared to a Suite of Java-based unit tests, but even here the MacBook Pro has no chance at all.</p>
<h3 id="frontend-build-times"><a href="#frontend-build-times" class="heading-anchor">Frontend Build Times</a></h3>
<p>The frontend is a Vue-based single-page application. As with Ruby, I had to use NodeJS with Rosetta 2, since not all used modules are compatible with ARM.</p>
<table>
	<thead>
			<tr>
					<th>Device</th>
					<th>Test duration</th>
			</tr>
	</thead>
	<tbody>
			<tr>
					<td>MacBook Pro native</td>
					<td>27.8 s</td>
			</tr>
			<tr>
					<td>MacBook Air with Rosetta 2</td>
					<td>20.7 s</td>
			</tr>
			<tr>
					<td>PC native</td>
					<td>20.6 s</td>
			</tr>
	</tbody>
</table>
<p>Well, it’s more than obvious now, that the MacBook Pro has no chance at all against my MacBook Air. It’s not just the performance. After a few seconds of load, the MacBook Pro sounds like my F/A-18C in DCS immediately before a carrier launch, while the MacBook Air has no fan and therefore makes no noise at all.</p>
<p>And the battery life. Oh my god. Ten straight hours of development with IntelliJ and Visual Studio Code is entirely possible now, all while staying cool and quiet.</p>
<p>Even the dreaded battery murderer Google Meet is no problem anymore. My MacBook Pro on battery would last perhaps 2.5h max. The MacBook Air is capable of 8, perhaps even 9 hours of Meet. It’s as insane as an 8h long Meet itself.</p>
<p>Ah, yes, there is another thing: Meet does not cripple the performance anymore. The MacBook Air is totally usable with a Meet going on, while my MacBook Pro becomes sluggish as hell and is barely usable (even without Chrome and frakking Google Keystone).</p>
<h2 id="conclusion"><a href="#conclusion" class="heading-anchor">Conclusion</a></h2>
<p>I will make it short: if your tools and languages are already supported or at least quite usable with Rosetta, go for it.  I would recommend 16 GB or more (depending on future models), if you want to buy one. I’m surprised that an 8 GB MacBook Air is that capable and to be honest, I don’t feel like that’s going to be a problem for a while, but no one regrets more RAM …</p>
<h3 id="air-vs-pro"><a href="#air-vs-pro" class="heading-anchor">Air vs Pro</a></h3>
<p>The 13” MacBook Pro is a little faster over longer periods of load due to active cooling, it has more GPU-cores, the loved or hated Touch Bar and a bigger battery. If you need this, go for it, but if you can wait, I’d recommend to wait for the new 14” and 16” Pro models.</p>
<p>They will be real power houses with 8 instead of 4 Firestorm cores, vastly more RAM and even bigger batteries. And hey, perhaps they come with MagSafe and some other ports we MacBook users didn’t see for a while.</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Ryzen vs Apple Silicon and why Zen 3 is not so bad as you may think</title>
      <link>https://webcodr.io/2020/11/ryzen-vs-apple-silicon-and-why-zen-3-is-not-so-bad-as-you-may-think/</link>
      <pubDate>Wed, 18 Nov 2020 22:34:23 +0000</pubDate>
      <guid>https://webcodr.io/2020/11/ryzen-vs-apple-silicon-and-why-zen-3-is-not-so-bad-as-you-may-think/</guid>
      <description>Apple’s M1 is a very impressive piece of hardware. If you look at the benchmarks, like SPECperf or Cinebench, it’s an absolute beast with a ridiculously low power consumption compared with a Ryzen 9 5950X.
Zen 3 is that inefficient? 10 W vs 50 W looks really bad for AMD, but the answer to this question is a little more complicated than this raw comparison of power usage.
Here are basic things to know:
</description>
      <content:encoded><![CDATA[<p>Apple’s M1 is a very impressive piece of hardware. If you look at the benchmarks, like SPECperf or Cinebench, it’s an absolute beast with a ridiculously low power consumption compared with a Ryzen 9 5950X.</p>
<h2 id="zen-3-is-that-inefficient"><a href="#zen-3-is-that-inefficient" class="heading-anchor">Zen 3 is that inefficient?</a></h2>
<p>10 W vs 50 W looks really bad for AMD, but the answer to this question is a little more complicated than this raw comparison of power usage.</p>
<p>Here are basic things to know:</p>
<ul>
<li>Apple’s M1 has four high power cores (Firestorm) and four high efficiency cores (Icestorm), this is called BIG.little architecture.</li>
<li>AMD’s Ryzen 9 5950X is a traditional x86 CPU with 16 cores and 32 Threads</li>
</ul>
<p>So what? The benchmarks are about single core performance and Ryzen needs 40 W more. What a waste.</p>
<p>Right, but this says nothing about the efficiency of a single core.</p>
<p>I don’t have a 5950X, but its older brother, the 3950X. Same core count and about the same power usage. While monitoring with HWINFO64 on a single core run of Cinebench R20 the used core needs about 10 - 12 W.</p>
<h2 id="okay-but-what-happened-to-the-other-38-watts"><a href="#okay-but-what-happened-to-the-other-38-watts" class="heading-anchor">Okay, but what happened to the other 38 watts?</a></h2>
<p>As you may know AMD introduced a so called chiplet architecture with Ryzen 3000. A Ryzen 9 5950X has three dies. Two with 8 cores each and a separate chip that handles I/O like PCIe 4, DDR4 memory and the Infinity Fabric links to the CPU dies.</p>
<p>This I/O die consumes 15 to 17 W. It’s a quite large chip produced in a 12 nm node by GlobalFoundries. That alone is a big reason for higher power usage compared to a modern node like TSMC’s N7P (7 nm) used for the other two chiplets.</p>
<p>Why 12 nm? It’s a compromise, since TSMCs 7 nm production capabilities are still somewhat limited and AMD takes a fairly large share of the capacity. All Zen 2 and 3 cores are produced in 7 nm, as are all modern AMD GPUs and of course there are other customers as well.</p>
<p>I hope AMD will improve the I/O die with Zen 4 (Ryzen 6000) dramatically. A modern process node and a bunch of better energy saving functions would do the trick.</p>
<h2 id="there-are-still-21-w-unaccounted-for"><a href="#there-are-still-21-w-unaccounted-for" class="heading-anchor">There are still 21 W unaccounted for!</a></h2>
<p>15 more cores are also unaccounted for. 21 divided by 15: about 1.4 W per core average. Seems a bit high, but possible. It depends on background tasks from the OS, the current Windows power plan etc.</p>
<p>To be fair, AMDs energy saving functions per core could be a little bit better. They are not bad but there’s room for improvements.</p>
<h2 id="process-nodes"><a href="#process-nodes" class="heading-anchor">Process nodes</a></h2>
<p>For a fair comparison we also have to include the process nodes. As mentioned above, Ryzen cores are manufactured in TSMC’s 7 nm node. Apple is one step ahead in this category. The M1 and its little brother A14 are already on 5 nm, again from TSMC.</p>
<p>This alone could account for up to 30% less power usage. There are no exact numbers available, but 20 to 30% would be reasonable.</p>
<h2 id="core-architecture"><a href="#core-architecture" class="heading-anchor">Core architecture</a></h2>
<p>Current Zen 3 cores and Apple’s Firestorm cores have fundamental differences in architecture. Modern x86 cores are small but clock quite high. On a single core load like Cinebench R23 you will get about 5 GHz from 5950X while a Firestorm core will only clock to 3.2 GHz.</p>
<p>Wait, what? Firestorm with 3.2 GHz is about as fast as Zen 3 with 5 GHz? That can’t be true. Yet it is. According to the benchmarks a Firestorm core can execute about twice the instructions per cycle (IPC) as a Zen 3 core.</p>
<p>Firestorm is an extremely wide core design with many processing units. This is complemented by absurdly large L1 caches and re-order buffers. Much larger than on any x86 core ever.</p>
<p>This allows Apple to lower the clock speed significantly without compromising performance. Lower clock speeds also mean lower voltage and power usage.</p>
<p>But there’s more: since the A13 (iPhone 11) Apple has quite many incremental power saving functions within every part of their SoCs. They can lower the power usage to an absolute minimum or even turn parts of the silicon on and off quite fast, to be ready when the user needs more computational power and as fast they turn it off.</p>
<p>Modern x86 CPUs have similar functions but not quite as advanced or in as many parts as current Apple SoCs. Remember AMD’s I/O die which has basically the same power usage all the time.</p>
<h2 id="instruction-set"><a href="#instruction-set" class="heading-anchor">Instruction set</a></h2>
<p>x86 is old and can be quite cumbersome to use. Apple&rsquo;s CPUs are based on ARM, a more modern instruction set. The same tasks can be achieved with fewer commands. This means faster computation and less power usage.</p>
<p>Under the hood current x86 CPUs have nothing to do with their older cousins, but the instruction set is still the same. To be fair, over the years AMD and Intel added way more modern instructions like AVX for certain operations, but the core is still 40 years old.</p>
<h2 id="conclusion"><a href="#conclusion" class="heading-anchor">Conclusion</a></h2>
<p>Taken all this into account, a Zen 3 is not that bad compared to a Firestorm core. Of course, Apple has advantages over x86, but they are more about the process node, different architecture or the instruction set, than about the efficiency of the cores themselves.</p>
<p>Well, and then there’s Intel. The quite slowly awakening giant is not without hope, but they are way behind Apple and AMD. As long as their high performance CPUs are stuck on 14 nm, they are &hellip; to put it simply, fucked.</p>
<p>10 nm is on its way, but there are still problems. The next release of desktop- and server-class CPUs will still be on 14 nm, but with a more efficient architecture backported from 10 nm CPUs. It will help, but they need a better process node and they need it asap.</p>
<p>10 nm could be ready for the big guys in 2021. At least new Xeons in 10 nm were announced. But the question is: how good is the node? Some of the already released 10 nm notebook CPUs are quite good, so Intel could be back in a year or two.</p>
<p>They also plan to release Alder Lake in 2021, a BIG.little CPU design. That would be much appreciated on notebooks, but software has to be ready. Without a decent support of the operating systems, such a CPU will not work properly.</p>
<p>There’s another problem: Intel’s 7 nm node. According to YouTubers like AdoredTV or Moore’s law is dead, 7 nm could be the 10 nm disaster all over again. Let’s hope not.</p>
<p>Three competing CPU vendors on par would be amazing. Not just for pricing, but also computational power. Look what AMD did in the past three years. If someone said in 2016 that AMD would kick Intel’s and nVidia’s ass in four years, he would have been called a mad man. The same with Apple.</p>
<p>2020 is a shitty year, but the hardware? Awesome would be an understatement.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
