Live data from Hacker News

Ask HN: Why hasn't x86 caught up with Apple M series?

news.ycombinator.com

351–360 of 640 posts

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#351

I considered getting a personal MBP (I have an M3 from work), but picked up a Framework 13 with the AMD 7 7840U. I have Pop!_OS on it, and while it isn't quite as impressive as the MBP, it is radically better than other Windows / Linux laptops I have used lately, battery life is quite good, ~5hr or so, not quite on par with the MBP but still good enough that I don't really have any complaints (and being able to up up…

5 hours seems a lot worse than the ~10 hours I get on my M4 Air.

I get 8 to 10 hours of light use on my personal ThinkPad. Or ~6 h of Netflix at 50% screen brightness, despite the lack of hardware decoding for DRM encrypted video on Linux. All of these are with a max charge threshold of 80%. 5 hours of battery life sounds rather limited to me, too.

But then the numbers are hardly comparable without having comparable workloads. If I were regularly running builds or had some other moderate load throughout a working day, that'd probably cost a couple of hours.

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#352

There’s a number of reasons, all of which in concert create the appearance of a performance gap between the two: * Apple has had decades optimizing its software and hardware stacks to the demands of its majority users, whereas Intel and AMD have to optimize for a much broader scope of use cases. * Apple was willing to throw out legacy support on a regular basis. Intel and AMD, by comparison, are still expected to run…

> Apple has had decades optimizing its software and hardware stacks to the demands of its majority users, whereas Intel and AMD have to optimize for a much broader scope of use cases.

But as you mention - they've at multiple times changed the underlying architecture, which surely would render å large part of prior optimizations obsolete?

> Software in x86 world is not optimized, broadly, because it doesn’t have to be.

Do ARM software need optimization more than x86?

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#353

Honestly, I have serious FOMO about this. I am never going to run a Mac (or worse: Windows) I'm 100% on Linux, but I seriously hate it that I can't reliably work at a coffee shop for five hours. Not even doing that much other than some music, coding, and a few compiles of golang code. My Apple friends get 12+ hrs of battery life. I really wish Lenovo+Fedora or whoever would get together and make that possible.

Despite OP's complaints (which are valid) I run Fedora on my Framework 13 (AMD) and I get 5 hours of work (10 ish Firefox tabs, multiple VS Code instances, terminals and Slack) without issue.

It's not 8-12, and the fans do kick up. The track pad is fine but not as nice as the one on the MacBook. But I prefer to run Linux so the tradeoff is worth it to me.

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#354
Chrome has been very conservative about enabling hardware acceleration features on Linux. Look under about://gpu to see a list. It is possible to force them via command line flags. That said, this is only part of the story.

There are different kinds of transistors that can be used when making chips. There are slow, but efficient transistors and fast, but leaky transistors. Getting an efficient design is a balancing act where you limit use of the fast transistors to only the most performance critical areas. AMD historically has more liberally used these high performance leaky transistors, which enabled it to reach some of the highest clock frequencies in the industry. Apple on the other hand designed for power efficiency first, so its use of such transistors was far more conservative. Rather than use faster transistors, Apple would restrict itself to the slower transistors, but use more of them, resulting in wider core designs that have higher IPC and matched the performance of some of the best AMD designs while using less power. AMD recently adopted some of Apple’s restraint when designing the Zen 5c variant of its architecture, but it is just a modification of a design that was designed for significant use of leaky transistors for high clock speeds:

https://www.tomshardware.com/pc-components/cpus/amd-dishes-m...

The resulting clock speeds of the M4 and the Ryzen AI 340 are surprisingly similar, with the M4 at 4.4GHz and the Ryzen AI 340 at 4.8GHz. That said, the same chip is used in the Ryzen AI 350 that reaches 5.0GHz.

There is also the memory used. Apple uses LPDDR5X on the M4, which runs at lower voltages and has tweaks that sacrifice latency to an extent for a big savings in power. It also is soldered on/close to the CPU/SoC for a reduction needed in power to transmit data to/from the CPU. AMD uses either LPDDR5X or DDR5. I have not kept track of the difference in power usage between DDR versions and their LP variants, but expect the memory to use at least half the power if not less. Memory in many machines can use 5W or more just at idle, so cutting memory power usage can make a big impact.

Additionally, x86 has a decode penalty compared to other architectures. It is often stated that this is negligible, but those statements began during the P4 era when a single core used ~100W where a ~1W power draw for the decoder really was negligible. Fast forward to today where x86 is more complex than ever and people want cores to use 1W or less, the decode penalty is more relevant. ARM, using fixed length instructions and having a fraction of the instructions, uses less power to decode its instructions, since its decoder is simpler. To those who feel compelled to reply to repeat the mantra that this is negligible, please reread what I wrote about it being negligible when cores use 100W each and how the instruction set is more complex now. Let’s say that the instruction decoder uses 250mW for x86 and 50mW for ARM. That 200mW difference is not negligible when you want sub-1W core energy usage. It is at least 20% of the power available to the core. It does become negligible when your cores are each drawing 10W like in AMD’s desktops.

Apple also has taken the design choice of designing its own NAND flash controller and integrating it into its SoC, which provides further power savings by eliminating some of the power overhead associated with an external NAND flash controller. Being integrated into the SoC means that there is no need to waste power on enabling the signals to travel very far, which gives energy savings, versus more standard designs that assume a long distance over a PCB needs to be supported.

Finally, Apple implemented an innovation for timer coalescing in Mavericks that made a fairly big impact:

https://www.imore.com/mavericks-preview-timer-coalescing

On Linux, coalescing is achieved by adding a default 50ms slack to traditional Unix timers. This can be changed, but I have never seen anyone actually do that:

https://man7.org/linux/man-pages/man2/pr_set_timerslack.2con...

That was done to retroactively support coalescing in UNIX/Linux APIs that did not support it (which were all of them). However, Apple made its own new API for event handling called grand central dispatch that exposed coalescing in a very obvious way via the leeway parameter while leaving the UNIX/BSD APIs untouched, and this is now the preferred way of doing event handling on MacOS:

https://developer.apple.com/documentation/dispatch/1385606-d...

Thus, a developer of a background service on MacOS that can tolerate long delays could easily set the slack to multiple seconds, which would essentially guarantee it would be coalesced with some other timer, while a developer of a similar service on Linux, could, but probably will not, since the scheduler slack is something that the developer would need to go out of his way to modify, rather than something in his face like the leeway parameter is with Apple’s API. I did check how this works on Windows. Windows supports a similar per timer delay via SetCoalescableTimer(), but the developer would need to opt into this by using it in place of SetTimer() and it is not clear there is much incentive to use it. To circle back not Chrome, it uses libevent, which uses the BSD kqueue on MacOS. As far as I know, kqueue does not take advantage of timer coalescing on macOS, so the mavericks changes would not benefit chrome very much and the improvements that do benefit chrome are elsewhere. However, I thought that the timer coalescing stuff was worthwhile to mention given that it applies to many other things on MacOS.

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#355

Battery efficiency comes from a million little optimizations in the technology stack, most of which comes down to using the CPU as little as possible. As such the instruction set architecture and process node aren't usually that important when it comes to your battery life. If you fully load the CPU and calculate how much energy a AI340 needs to perform a fixed workload and compare that to a M1 you'll probably find s…

All that to say: M1 is pretty fast, but the reason the battery life is better has to do with everything other than the CPU cores. That's what AMD and Intel are missing. This isn't true. Yes, uncore power consumption is very important but so is CPU load efficiency. The faster the CPU can finish a task, the faster it can go back to sleep, aka race to sleep. Apple Silicon is 2-4x more efficient than AMD and Intel CPUs d…

> Apple Silicon is 2-4x more efficient than AMD and Intel CPUs during load while also having higher top end speed.

This is not true. For high-throughput server software x86 is significantly more efficient than Apple Silicon. Apple Silicon optimizes for idle states and x86 optimizes for throughput, which assumes very different use cases. One of the challenges for using x86 in laptops is that the microarchitectures are server-optimized at their heart.

ARM in general does not have the top-end performance of x86 if you are doing any kind of performance engineering. I don't think that is controversial. I'd still much rather have Apple Silicon in my laptop.

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#356
post #229

I can build myself a new amd64 box for just under €200. Under €100 with used parts. Some older Dell and Lenovo laptops even work with coreboot. An Airbook sets me back €1000, enough to buy a used car, and AFAICT is much more difficult to get fully working Linux on than my €200 amd64 build. Why hasn't apple caught up?

When netbooks ($400 notebooks) were all the rage, Steve Jobs was asked why Apple didn’t make one. And he said they didn’t know how to make a cheap laptop that didn’t suck. And he was right. Netbooks mostly sucked. Same with Chromebooks. There’s nothing to be gained by racing to the bottom. You can buy an m1 laptop for $599 at Walmart. That’s an amazing deal.

    > You can buy ... for $599
Not sure why you'd think any random nerd has that kind of money. And Walmart isn't exactly around the corner for most parts of the world.

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#357
A friend at grad school was asking me for advice -- he had an "in" at Intel -- make $250k and do nothing. A friend had promised a basically no-show position for him. My friend was debating between this $250k/yr no-show position at Intel (no growth) vs something elsewhere which was more demanding but would provide more growth.

This isnt the only no-show position I've heard about at Intel. That is why Intel cannot catch up. You probably cannot get away with that at Apple.

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#358
post #348

There’s a number of reasons, all of which in concert create the appearance of a performance gap between the two: * Apple has had decades optimizing its software and hardware stacks to the demands of its majority users, whereas Intel and AMD have to optimize for a much broader scope of use cases. * Apple was willing to throw out legacy support on a regular basis. Intel and AMD, by comparison, are still expected to run…

It’s a bit unfair to say apple threw out backwards compatibility. Each time they had a pretty good emulation story to keep most stuff (certainly popular stuff) working through a multi-year transition period. IMO, this is better then carrying around 40 years of cruft.

Apple purposely make it so after 3 new versions of the OS you cannot upgrade the OS on the hardware any further. This in turn means you cannot install new software as the applications themselves require the newer versions of the OS. It has been this way on apple hardware for decades, and has laid the foundation of not ever needing to provide backwards compatibility for more than a few years as well as forcing new hardware purchases. The 'emulation story' only needs to work for a couple of generations, then it itself can be sunsetted and is not expected to be backwards compatible with newer OSes. It is also the reason it is pretty much impossible to upgrade CPUs in Apple machines.

> IMO, this is better then carrying around 40 years of cruft.

Backwards compatibility is such a strong point, it is why windows survives even though it has become a bloated ad riddled mess. You can argue which is better, but that seriously depends on your requirements. If you have a business application coded 30 years ago on x86 that no developer in your company understands any more, then backwards compatibility is king. On the other end of the spectrum if you are happy to be purchasing new software subscriptions constantly and having bleeding edge hardware is a must for you, then backwards compatibility probably isnt required.

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#359

First, Apple did an excellent job optimizing their software stack for their hardware. This is something that few companies have the ability to do as they target a wide array of hardware. This is even more impressive given the scale of Apple's hardware. The same kernel runs on a Watch and a Mac Studio. Second, the x86 platform has a lot of legacy, and each operation on x86 is translated from an x86 instruction into RI…

This seems mostly misinformed. 1) Apple Silicon outperforms all laptop CPUs in the same power envelope on 1T on industry-standard tests: it's not predominantly due to "optimizing their software stack". SPECint, SPECfp, Geekbench, Cinebench, etc. all show major improvements. 2) x86 also heavily relies on micro-ops to greatly improve performance. This is not a "penalty" in any sense. 3) x86 is now six-wide, eight-wide,…

A whole lot of bluster in this thread but finally someone whose actually doing their research chimes in. Thank you for giving me a place to start in understanding why this is so deeply a mystery!

Re: Ask HN: Why hasn't x86 caught up with Apple M series?

#360

There’s a number of reasons, all of which in concert create the appearance of a performance gap between the two: * Apple has had decades optimizing its software and hardware stacks to the demands of its majority users, whereas Intel and AMD have to optimize for a much broader scope of use cases. * Apple was willing to throw out legacy support on a regular basis. Intel and AMD, by comparison, are still expected to run…

I generally agree but what's Qualcomm's excuse?
Post reply on HN