20 ms·
How M1 Macs feel faster than Intel models: it’s about QoS
- jackcviers3 6y agoSo, like nice[1], except the developer sets the level of importance ahead of time? Makes sense, as long as I can reprioritize if needed. 1. https://en.wikipedia.org/wiki/Nice_(Unix) https://en.wikipedia.org/wiki/Nice_(Unix)
- bombcar 6y agoIt's nice but with additional limitations - on a normal Unix system even if you nice everything to the lowest level possible they'll still take over all cores. This limits things below a certain nice level to the efficiency cores, meaning that the performance cores are always available for foreground action.
- damagednoob 6y agoSo nice + taskset[1]? 1: https://linux.die.net/man/1/taskset https://linux.die.net/man/1/taskset
- archi42 6y agoSeems so. Just that it works "automagically" and reserves some cores for certain priority groups. Maybe one can write a script/daemon that `taskset`s all tasks with a certain niceness range (or by additional rules) to a few "background cores" and everything else to the "interactive cores"? On Linux you might also get some problems with kworker threads landing in the wrong group, but I'm not that much into Kernel internals I've to admit.
- ape4 6y agoOf course the applications (programmers of the applications) need to declare their "nice" levels correctly - they can't be greedy
- stefan_ 6y agoNothing has ever stopped Apple from pinning indexing work to specific cores. They just didn't give a shit.
- bombcar 6y agoI suspect they did it less for performance and more for energy savings - this prevents the scheduler from moving a background process to a performance core (which a naive one would do if it saw the performance core underutilized).
- astrange 6y agoIt's always done this but the effect wasn't visible on x86.
- ytch 6y agoMaybe like the big.little cores of many ARM CPU in Android phone? I'm not familiar with Android APP, maybe there are similar APIs in Android?
- agloeregrets 6y agoIt's the same big.Little concept, slightly tweaked to allow this QoS work, I believe most of it was then used on Android but I doubt that Android uses the APIs well if they exist.
- nicoburns 6y agoThis is a pretty smart strategy. I'd say the majority of the time when something is slow on my machine, it's because there's a resource intensive background process (that I don't really need to complete quickly) eating up all my system resources. It seems like the same strategy would also make sense on Intel processors, although it probably requires at least 4 cores to make sense?
- lupire 6y agoYou can do it on one processor with a process/thread scheduler. This is what makes multitasking possible in general.
- nicoburns 6y agoWell yes, but presumably this impacts responsiveness. The whole point of this strategy is to keep cores free for interactive tasks.
- mnw21cam 6y agoThis is extraordinarily basic stuff. We knew how to do this kind of multitasking, with priorities, back in the 80s (or earlier). Yet people still don't understand it. As an example, a while back I ran a multi-threaded process on a shared work server with 24 cores. It used zero I/O and almost no RAM, but had to spend a couple of days with 24 threads to get the result. I ran it inside "chrt -i", which makes Linux only run it when there is absolutely nothing else it could do. I had someone email and complain about how I was hogging the server, because something like 90% of the CPU time was being spent on my process. That's because their processes spent 90% of their time waiting for disc/network. My process had zero impact on theirs, but it took some explaining.
- StavrosK 6y agoThat's a useful command to know, thanks! However, shouldn't `nice` be handling that sort of stuff? Do you know why there are two commands for the same thing (as far as I can see)?
- adriancr 6y agoI'm still assuming it's faster due to unified memory architecture, latest generation lithography and less on tailored behavior for their OS. An AMD/Intel using same soldered RAM next to CPU and same process node would give Apple a run for its money. Still, the optimizations on OS side are interesting here.
- skohan 6y agoAs far as I understand, it has a lot to do with the actual design of the processor[1], and not so much to do with the on-chip memory or the software integration. [1]: https://news.ycombinator.com/item?id=25257932 https://news.ycombinator.com/item?id=25257932
- Toutouxc 6y agoI thought the "unified memory" meme had been debunked multiple times here.
- SigmundA 6y agoMemory is unified its just not on die. CPU and GPU and AI share unified memory which means zero copy transfers between them.
- icedchai 6y agoI laughed when they called it “unified memory.” Amazing what some marketing can do. In previous years, that was called “shared graphics memory” and it was only for low end systems.
- Aaargh20318 6y agoShared graphics-memory is not the same as unified memory. In a shared graphics-memory system, a part of the system RAM is reserved for the GPU. The amount of RAM reported to the OS is the total RAM minus the chunk reserved the GPU uses. The OS only can use it's own part, and cannot access the GPU memory (and vice versa). If you want to make something available to the GPU, it still has to be copied to the reserved GPU part. In unified memory both the OS and the GPU can access the entire range of memory, no need for a (slow) copy. Consoles use the same strategy (using fast GDDR for both system and GPU), and it's one of the reasons consoles punch above their weight graphically. The main reason that high-end GPUs use discrete memory is because they use high-bandwidth memory that has to live very close to the GPU. The user-replaceable RAM modules in a typical PC are much too far away from the GPU to use the same kind of high bandwidth memory. If you drop the 'user replaceable' requirement and place everything close together, you can have the benefits of both high bandwidth and unified memory.
- whatever1 6y agoLaunching apps takes ages on M1 mini. Reminded me of the good Windows Phone times.
- tylerfontaine 6y agoStrange. With the exception of electron apps (which are slow everywhere), I've found my M1 mini to be extremely responsive. Much moreso than my 16" mpb.
- whatever1 6y agoCold start of Electron, MS office, Affinity (all ARM versions) takes me north of 15". 8GB M1 Mini, so maybe that makes the situation worse.
- Toutouxc 6y agoAffinity Photo starts in 15 seconds on my M1, which IMO is not okay. It's just as slow as on my Haswell Intel Mac. Everything else launches in a second or so. Spotify (Electron) draws a window in three seconds, but takes another four to display all content.
- jermaustin1 6y agoI have the 8GB M1 as my daily driver, the only apps that take a long time for me (but NOWHERE NEARE 15 seconds - maybe close to 5, but I'm not counting) are visual studio Mac (which is probably rosetta), Unity (which IS rosetta) and blender (also rosetta).
- dboreham 6y agoTypo in title. Doesn't parse as a result.
- opan 6y ago"is" should be "it's" probably.
- giuliomagnifico 6y agoOk, corrected, sorry.
- giuliomagnifico 6y ago?! Sorry but I haven’t understood.
- KMnO4 6y agoThankfully my human brain is robust enough to understand by the context.
- astrange 6y agoThe only people who think human brains run on strict grammar rules are K-12 language teachers.
- coldtea 6y agoWell, they don't just "feel" faster. They also complete lots of real-world tasks in shorter times, often significantly shorter than the last Intel Macbook Pro.
- oregontechninja 6y agoI was an unbeliever, but we got some M1 Mac Mini's and this is the result. They even beat the dedicated workstation many of our people have set up. I get when people say it won't quite match a new ryzen for compute power, but in all of our tests, the M1 beat out all our workstations.
- spockz 6y agoWhat workloads do you run? I’ve got a 16GiB M1 mbp and a 2019 maxed intel and when compiling Java/sbt projects the intel is significantly quicker, albeit also much loader and power hungry.
- alienalp 6y agoThat compiler most probably not native to m1 arm processor.
- spockz 6y agoIndeed, I was using the GraalVM jdk11 build which wasn’t available in a native version indeed.
- alecthomas 6y agoAs the sibling comment mentions, if you're running Intel JDK on M1 it will be slow. You can find M1 native JDK builds here: https://www.azul.com/downloads/?version=java-11-lts&os=macos&architecture=arm-64-bit&package=jdk https://www.azul.com/downloads/?version=java-11-lts&os=macos...
- hugi 6y ago
- pjc50 6y agoInteresting solution to the problem of app and OS developers wasting CPU power at greater rates than Moore's law can deliver it: just shunt all the stuff the user isn't looking at (and therefore doesn't care about the timeliness of) onto a slower processor.
- CitizenKane 6y agoThis certainly makes a lot of sense, and it's a brilliant strategy to improve overall performance. But it doesn't account for the full picture either. My M1 Macbook Pro feels about as responsive as my desktop system with an AMD Ryzen 3900X, which is impressive to say the least. It doesn't quite have the raw computing power of the 3900X, but given that it's a portable device that's something else.
- nottorp 6y agoWell, they did it first in iOS which is more responsive than Android even when compared to devices that win benchmarks vs the iPhone. It's just doable when you care enough to optimize the OS for responsiveness.
- agloeregrets 6y agoMuch like the M1, I don't think anything actually wins benchmarks vs the iPhone. There's display refresh rate and a few multicore stores that are closer but in any real world test, Single core dominance wins out. (Plus the big/little design in the A series chips is better than the three scales seen in QC chips as QC backfills the single large core with a ton of little cores to make the multicore numbers look competitive when in reality, any multithreaded task of two cores is much faster and you don't end up with mismatched race conditions.)
- nottorp 6y agoAre you sure? iOS has been more responsive from day 1 (I mean the first 2-3 iphone versions), when they were using an off the shelf CPU that everyone else had.
- smoldesu 6y agoI think the commenter is saying that iOS provides no discernible performance advancements over Android. If you ran Android on an M1, it likely would score just as well as an iOS/MacOS machine.
- cmsj 6y agoI'm curious if there is some architectural limit that prevents Apple from doing something similar on Intel Macs, at least ones with 8+ cores. The scheduler could arbitrarily nominate 4 cores as "efficiency" cores and keep them for background tasks, leaving the rest free for "performance".
- twoodfin 6y agoI think the issue is that thermals, and thus overall efficiency, is optimized on the Intel chips when long-running work is split evenly across the cores.
- archi42 6y agoWithout knowing the inner workings of Apple's scheduler: I don't think there is any reasons this wouldn't work on x86 hardware. All you need is some API to tell the scheduler whether a task should be done "asap" or "whenever". But you then get a huge tradeoff: If you reserve over 50% of the computational power for "asap" stuff, then all the "whenever" stuff will take twice as long as usual (assuming the tasks to be limited by compute power). On a 8C Intel that means that, for a lot of stuff, you're now essentially running on a 4C Intel. Given the price of these chips that MIGHT be a difficult sell, even for Apple. On the M1 they don't seem to care.
- kingsuper20 6y ago>All you need is some API to tell the scheduler whether a task should be done "asap" or "whenever". We could call it ::SetThreadPriority()
- agloeregrets 6y agoFor intel that would cause some serious thermal issues. The Four E cores in the M1 use about the same amount of power as one big core (5w total). In an Intel chip that would mean the four 'E' cores would use probably 10 watts each, that's 40 watts cooking a chip. Intel does have a chip for you though, they have a version with mixed UlV cores and big cores.
- 6y ago
- jpraamstra 6y agoWould it be possible to achieve something like this in windows by pinning certain processess to specific cores? I've googled a bit and came accross this article below where it shows how to set the affinnity for a process to specific cores, and it looks like a fun experiment to do this with the system processess to see whether the performance of other applications will improve. :) It would be a bit of a hassle to figure out which processes would all need to be changed, and whether these changes persist after rebooting and there's probably a lot more that I didn't think off though.. https://www.windowscentral.com/assign-specific-processor-cores-apps-windows-10 https://www.windowscentral.com/assign-specific-processor-cor...
- bvm 6y ago> These [QOS levels] turn out to be integer values spread evenly between 9 and 33, respectively. Anyone know why this is? seems fairly arbitrary...why not have 1,2,3,4,5?
- stan_rogers 6y agoThey're a bit mask, with the LSB always set. The values are 100001 (33), 011001 (25), 010001 (17), and 001001 (9). And they're probably ORed with other values so multiple parameters can be set with a single word.
- oddevan 6y agoBest guess: either (1) it maps to internal values that macOS uses, or (2) they wanted to build in the potential to have more granular values later.
- varispeed 6y agoPeople say that Ryzen is faster - but if it has a fan, then this is a deal breaker. I have become so annoyed by fans I often just stop work when they start whirling, go make a coffee etc. It seems like M1 is now the only laptop that can let you work in silence and be productive.
- theresAt 6y agoM1 will soon have a fan due to the overheating issue. Although I imagine given how slow the response was on the butterfly keyboard issue it might be a few years out.
- coldtea 6y agoWhat overheating issue? There isn't one in M1.
- kllrnohj 6y agoThere isn't any thermal slowdowns on the M1 devices with a fan, no. The only M1 device without a fan shows thermal limitations, though. Not an overheating issue, no, but the M1 still benefits from a fan, and obviously whatever Apple does in a Mac Pro class machine will also have a fan. They aren't going to keep at ~25W in a full size desktop, that'd be nonsense.
- gjsman-1000 6y agoOnly if you run it at 100% for like half an hour and even then the throttling is so minor that most reviewers said to not buy the MBP for a fan.
- gjsman-1000 6y agoWhat overheating issue? There isn’t one.
- toast0 6y agoWhen was the last time Apple made anything with good thermal design? The M1 is designed for this. Wide cores that do a lot per clock, but can't be clocked high is perfect, because Apple would rather not clock high. Intel and AMD are still fighting the MHz wars, and can't release a core design that doesn't approach 5 GHz, even if the lower power chips won't.
- zelon88 6y agoThat is all well and good. Great actually. And it makes sense. The high efficiency reduced instruction set computer has highly optimized architecture to improve efficiency. But we all knew that deep down. It's like the Ford Tempo. A mere 80 horsepower mated to a well designed and highly optimized transmission gave levels of performance that were higher than other cars in the same market. What I can't stand are all the people saying the M1 is capable of replacing high end x86 computers. It's like owning a Tempo and mistakenly thinking your highly specialized transmission means you can walk up and challenge a 6.7L Dodge Challenger to a race. It's completely ridiculous and demonstrates a stunning lack of self awareness.
- proxyon 6y agoI think you're right on this. I've also been irritated at the "eGPUs / dGPUs are no longer necessary" crowd. If an SoC GPU with the performance / size of an RTX could fit into a notebook we'd actually have them in notebooks... but we don't. The fact of the matter is that this technology doesn't exist. So the allegations that GPUs are no longer necessary because SoCs have already wholesale replaced them are comical.
- riggsdk 6y agoI'm curious what you think of all the benchmarks that sais otherwise. In a race between a motorized lawn mower and a racecar - if the lawn mower wins which one is ultimately the best "racecar"?
- steve76 6y agoMore like, I need a racecar, because I live in a Mad Max death race. vs I ride a quiet lawn mower at dawn and do my chores in a happy culture where people help each other. My computer is 10 years old. I paid $100 for it when I bought it used. It runs fine because I know what I'm doing, and now I feel guilty about that. I wished I would run slack now. I bought it because of 4K streaming, but then shortly after all the home theater devices came out. Should we really be encouraging borrowing and debt so people can buy new TVs and phones they throw away every year? Wouldn't that capital be better spent on something like medical research? You can borrow all the money you want. Good luck getting a job with them.
- AshamedCaptain 6y agoWhile I have my doubts whether this is the main reason for the perceived performance, it reminds me of how BeOS was able to also show incredible "apparent" performance on even m68k-level hardware.
- CyberDildonics 6y agoEven windows prioritizes programs that have focus over those that don't to increase interactivity.
- twoodfin 6y agoI wonder if shunting background processes to the slower efficiency cores has a salutary effect on other elements of system load. I’m thinking of tasks like Time Machine, which presumably are throwing out IOPS at a commensurately lower rate when effectively throttled by the efficiency cores.
- Lvl999Noob 6y agoWhat about priority inversion? If a high QoS thread waits on a low QoS one? It seems like it would be a bigger issue here as the low QoS threads are only ever run on half the cores.
- ejdyksen 6y agoGrand Central Dispatch (the OS-level framework that handles these QoS classes) elevates the priority of a queue if there is high priority work waiting on low priority work to finish. https://developer.apple.com/library/archive/documentation/Performance/Conceptual/EnergyGuide-iOS/PrioritizeWorkWithQoS.html#//apple_ref/doc/uid/TP40015243-CH39-SW44 https://developer.apple.com/library/archive/documentation/Pe...
- astrange 6y agoImportantly it doesn't do this for dispatch_async/dispatch_semaphore/dispatch_block_wait.
- bryanlarsen 6y agoThese kinds of optimizations often harm benchmarks. Benchmarks are batch jobs, even the ones that try and mimic interactive sessions. Apple has made a latency/throughput optimization that often harms throughput slightly. This is the right call, but benchmarks are the reason why this low hanging fruit isn't being picked on the Intel side.
- fpoling 6y agoThis should not harm benchmarks unless they mark their threads as background. As for a particular strategy I presume Apple could, for example, use 6 high-performance cores instead of 4+4 hybrid. But then thermal management will be an issue. So the choice was about throughout/latency/energy efficiency. Using simple low-performance cores for tasks that can wait is very good strategy as one can put more of those cores as opposite to running the performance core under a low frequency.
- bryanlarsen 6y agoI was thinking about things like the HZ setting in Linux. Lowering the setting will get you a slight throughput advantage but interactive use will be not as smooth.
- nikanj 6y agoMy 16 inch pro Intel is plenty fast - for the first 45 seconds before thermal throttling kicks in. I have a feeling the M1 is faster because it can actually do work for more than just the briefest bursts
- bjoli 6y agoApples intel MBP thermals are pretty abysmal wrt noise. My off brand 7th gen i7 sounds about the same as my colleagues similarly species MBP, but never throttles. There were even people saying they deliberately sabotaged their intel thermals to make the up and coming M1 look better.
- gjsman-1000 6y agoThose conspiracy theories were never confirmed. Linus thought the MacBook Air Early 2020 model’s cooling was clearly designed for an M1, but then the M1 launched without a fan at all.
- fomine3 6y agoI don't believe the conspiracy, but as a result, bad thermal designs works as great advertisement for M1.
- post_break 6y agoThe problem I ran into the other day, had an app crash taking 50% of cpu. I was on the couch for hours on battery. Only noticed when my battery life was at 60% when normally it would be at 85%. My intel machine would have alerted me by burning my legs and trying to create lift with the fans.
- geerlingguy 6y agoHa, speaking of burning legs, I was doing some video editing in FCPX last night, and I had to keep changing positions trying to optimize for not burning my legs too badly and not blocking the air flow through the vents on the bottom/sides causing even more throttling.
- kryps 6y agoIt does not just feel faster, in many cases it is faster. E.g. compiling Rust code is so much faster that it is not even funny. cargo install -f ripgrep takes 22 seconds on a Mac Book Air with M1, same on a hexacore 2020 Dell XPS 17 with 64GB RAM takes 34 seconds.
- Nullabillity 6y agoHard to compare without mentioning the actual CPU in it. FWIW my Ryzen 3900X completes that compile in 15s. To be fair, that is a relatively high-end desktop CPU, but it's also a massive margin for a last-gen model.
- throwaway5752 6y agoWe also have to consider the i7 and M1 run at about 1/7 the TDP of the Ryzen. Just underscores the good design behind the QoS and judicious use of the Performance cores vs Efficiency cores.
- cbsmith 6y agoYeah, but that's previous generation. Get a 5850U or even a 5980HX...
- sundvor 6y agoMy water-cooled 3900XT is locked to 4.4ghz all cores with relatively fast double banked 2x16GB c15 3600mhz memory. (It never drops under 4.4 on any of the 12/24 cores.) Also has a Samsung 980 1TB drive, and a 3070 GPU; the system truly is extremely quick. (Win10+WSL2). (I'll have to try that compile in the next day or so; will reply to myself here).
- agloeregrets 6y agoIn native Typescript compile of a very large angular app I see an even more dramatic 1:20s to 40s compared to a desktop i9. I feel as if the M1 may have been designed around a detailed and careful look at how computers and compliers work and then designed a CPU around that rather than the other way around. It's like buying a car and modifying to take it racing vs buying a race car, the race car was designed to do this.
- bjackman 6y agoFWIW Android (and surely iOS, although I don't know anything about that in particular) have had systems like this for a long time. Aside from all the task scheduler smarts in the kernel itself, there are all kinds of things that can be marked as low priority so they run on the LITTLE (what Apple calls "efficiency") cores, while e.g. a UI rendering thread might go straight to a "big" ("performance") core even if its historical load doesn't show it using much CPU b/w, because it's known (and marked as such by Android platform devs) to be a latency-senstive element of the workload. Been a few years since I worked on this so I'm a bit fuzzy on the details but it's interesting stuff! Without this kind of tuning, modern flagship devices would run like absolute garbage and have terrible battery life.
- grishka 6y agoWhile yes, the hardware had been there for a long time, Android hasn't been taking much of an advantage of it and I'm not quite sure it does now. Google Play likes to do shit in the background. A lot of it. All the time. Even if you have <s>deliberate RCE</s> auto-update disabled in settings, it will still update itself and Google services, silently, in the background, without any way to disable that. And while it's installing anything, let alone something as clumsy as Google services, your device grinds to a halt. It sometimes literally takes 10 seconds to respond to input, it's this bad. It's especially bad when you turn on a device that you haven't used in a long time. So it definitely wasn't scheduling background tasks on low-power cores, despite knowing which tasks are background and which are not (that's what ActivityManager is for). My understanding from looking at logcat was that this was caused by way too many apps having broadcast receivers that get triggered when something gets installed. Now, in Android 11 (on Pixel 4a), this was partly alleviated by limiting how apps see other apps, so those broadcasts don't trigger much anything, and apps install freakishly fast. That, and maybe they've finally started separating tasks between cores like this. Or maybe they started doing that long ago but only in then-current kernel versions, and my previous phone was stuck with the one it shipped with despite system updates.
- selimnairb 6y agoI was wondering how macOS scheduled the efficiency cores but was too lazy to dig into the docs. Thanks!
- artursapek 6y agoThe other half of the story for the efficiency cores seems to be the battery life. Most of these non-urgent background tasks are put on efficiency cores not only to separate them from my applications, but also to enable this insanely good battery life.
- jws 6y agoThere is also a thermal benefit. Using the high efficiency cores puts a lower load on the cooling system. So even if the computer is plugged in and the performance cores are idle it may be best not to use them and let the cooling system gain some headroom for when the performance cores are needed.
- artursapek 6y agoGreat point. Overall it seems like a very well designed system.
- dsabanin 6y agoFinally, setting all these QoS priorities on DispatchQueue's is paying off big time.
- xbar 6y agoAn universally used, opinionated API with enough flexibility to let developers express their ideas about priority really helps.
- astrange 6y agoMost people set way too many of those. Especially "background", where you're in for a surprise if you hit the actual background performance guarantees, since it may not run for minutes.
- deleted 6y ago[deleted]
- hyperluz 6y agoDoes having the actual best single thread performance available on market, has anything to with it? https://www.cpubenchmark.net/singleThread.html https://www.cpubenchmark.net/singleThread.html
- wiremine 6y agoSounds like the consensus here is that the M1 feels faster, and is actually faster, for a lot of tasks. So, for a lot of engineers, the M1 is the better choice over Intels. (Faster compile times are a good thing for devs, among other things) In that regard, the moment feels similar to the mid 2000s, when you suddenly saw a huge uptick in Macbooks at technical conferences: software developers seemed to gravitate in droves to the Mac platform (over windows or linux). Over the last 5+ years, that's cooled a bit. But I wonder if the M1 will solidify or grow Apple's (perceived) dominance among developers?
- artursapek 6y agoI switched away from Macs to Thinkpads when the butterfly keyboards came out. Just happily switched back to Macs and loving my M1 Air.
- simondotau 6y agoIt’s amazing how much of a dumpster fire the butterfly keyboard was, but perhaps more bewilderingly how long they persisted with it. That keyboard might well have done more than any other product design decision in the last decade to push people away from the Mac platform.
- artursapek 6y agoI think it did, and the touch bar was a close second. Thankfully, whoever was in charge of those decisions seems to have lost decision-making power and Apple has walked back both.
- totalZero 6y ago> whoever was in charge of those decisions seems to have lost decision-making power I guess we're both speculating here, but even if the same people were in charge, I think they breathed a sigh of relief when they realized that the personal computing segment had spiced up again. From about 2014 to 2019, Mac revenue basically plateaued in line with the entire laptop market. People were crazy about phones but laptops had hit a wall. When you have to sell laptops to people whose yesteryear laptops do everything they need, you start adding random bullshit to the product because you have to capture the market's attention somehow. I think this is how we ended up with the touch bar. It's a step backward, but it's flashy and made the product look fresh(er) despite the form factor being identical to what they were selling in 2013.
- jtbayly 6y agoThis strategy has had a strange negative effect for me a couple of times. It used to be that I would notice rogue background tasks eating up my processor because I could feel the UI acting slow and the fans would kick on. Now the only indication I get is my battery depleting more rapidly than expected. The UI is completely responsive still, and there are no fans. But I’m never checking my battery level anymore, so I don’t catch these processes for much longer.
- bombcar 6y agoI have Pluto running on a side monitor and sometimes catch the processors going insane when I don't expect it. https://news.ycombinator.com/item?id=25624718 https://news.ycombinator.com/item?id=25624718
- dboreham 6y agoAll this reminds me of when the HP PA machines were first introduced. Loads of posts about how compilation was now so fast that the screen turned red due to time dilation, etc. Of course now nobody remembers PA.
- jmull 6y agoYou're talking about the HP's old precision architecture, right? https://en.wikipedia.org/wiki/PA-RISC https://en.wikipedia.org/wiki/PA-RISC That's an interesting comparison because it's another case where a big player created their own chips for a competitive advantage. There are surely some lessons in there for Apple silicon, but I don't there there's any particular reason to think it will follow the same path as HP PA. PA started in the '80s. It was aimed at high-end workstations and servers. My impression was that the value proposition was narrow: it was sold to customers who needed speed and had a pretty big budget. Until checking now, I was unaware, but it seems to have carved out a niche and was able to live there for a while, so it wasn't exactly a failure. Time will tell how apple silicon fares. Today the M1 is a fast, power-efficient, inexpensive chip, with a reasonable (and rapidly improving) software compatibility story, and is available in some nice form factors... so basically a towering home run. But we'll just have to see how Apple sustains it over the long run. Frankly, they can drop a few balls and still have a strong story, but it's hard to project out 5, 10, 20 years and understand where this might end up. (Personally, I'm almost surely going to get an Apple silicon Mac, as soon as they release the one for non-low-end machines. The risk looks small, the benefits look big.)
- bombcar 6y agoThe real key for Apple is they already had a huge customer for their new chip - the iPhones and iPads have been using it for years. This means they do not have to be dependent on Mac sales to support M1 development - they can amortize it over the largest phone manufacturer in the world. And every time they do a successful architecture switch they make it easier to do it again in the future. If the IntAMD386 becomes the best chip of 2030 they can just start using it.
- apexalpha 6y ago"Because Macs with Intel processors can’t segregate their tasks onto different cores in the same way, when macOS starts to choke on something it affects user processes too." Why is this? I understand that Intel chips don't use BIG/little but couldn't you assign all OS/background tasks to one core and leave the other cores for user tasks? Shouldn't the scheduler be able to do this?
- cogman10 6y agoProbably a fight with CPU frequency ramping. You could put all the tasks on one core, but then you risk the CPU frequency spiking when it shouldn't causing more power to be drawn than necessary. With slow light power cores, that's less of an issue.
- wmf 6y agoThe OS also controls the frequency so it could lock the background core(s) at low frequency.
- jtriangle 6y agoBecause they didn't design the OS to do that. You very well could lock a core or two at low freq/power and assign background tasks to that. It's not really a new or exotic idea. macOS doing this is a side effect of them needing to do so, with the added benefit of it actually making things nicer all around. They could very well do this on intel/amd chips to the same effect. The bummer is, we really don't know how good the silicon is, because nothing but macOS runs on it natively, so you can't really get an apples to apples comparison.
- defaultname 6y agoInteresting, enjoyable read. The conclusions seem a bit off though -Low QoS tasks are limited to certain cores. This doesn't necessitate efficiency cores (though it makes sense if you want power efficiency in a mobile configuration) and they could as easily be performance cores. The core facet is that the OS has core affinity for low priority tasks and quarantines them to a subset of cores. And it has properly configured low priority tasks as such. -It also has nothing to do with ARM (as the original title surmised). It's all in the operating system and, again, core affinity. Windows can do this on Intel. macOS/iOS has heavily pushed priorities as meaningful and important, so now with the inclusion of efficiency cores they have established their ecosystem to be able to use it widely.
- lupire 6y agoIf it has nothing to do with ARM, why doesn't Mac do it at similar speed on Intel?
- defaultname 6y agoThe focus of the linked article is responsiveness/user interaction, attributing that to efficiency cores. Apple can achieve exactly the same responsiveness benefit on their Intel devices by, as mentioned, limiting low priority tasks to a subset of cores. Say 2 of 6 real cores on a MBP with an i7. Apple actually pushes low priority tasks to the efficiency cores for power efficiency reasons (per the name), not user responsiveness. So that MBP runs for longer, cooler on a battery because things that can take longer run on more efficient, slower cores. They do the same with the efficiency cores on modern iOS devices. The "feeling faster" is a side effect. I am talking about that side effect which isn't ARM specific. And FWIW, Intel is adding efficiency/"little" cores to their upcoming architectures. Again for efficiency reasons.
- bombcar 6y agoThere's no point in shuffling background processes to a subset of cores if it doesn't provide power-savings. It sounds like upcoming Intel chips will have the ability to run efficiency-mode on some cores, at which case OS-level code to do shuffling makes sense.
- dep_b 6y agoIt would be interesting to see if there are also optimisations to keep the main (UI) thread clear as much as possible. I mean if I just clicked a button then probably that is the most interesting thing for me to happen, so responding to that click should not be blocked by other high priority tasks. I often have the feeling on my i9 machine it's almost idle but the specific core of my UI is working on something else which I don't particularly care for at the moment I'm interactive with the computer.
- MrFoof 6y agoWhat's impressive is Apple's first "high-end" custom silicon is about equal performance to an AMD Ryzen 7 5600X. That's not bad! However the M1 is only about 20-25% of the power consumption of the Ryzen 7 5600X. That's crazy! It'll be very interesting to see what the M3 or M4 look like (especially in X or other higher end variants) several years from now. We already have tastes of it from Marvell, Altera, Amazon and others, though it looks as if we will see ARM make huge headway in the data center (it already is) and even on desktops before 2025.
- robotresearcher 6y agoI wonder how much of this nice result could be achieved on a homogenous CPU if everyone used an API that expressed priorities on a fine grained task level. Process priority and CPU affinity is already a thing. But I don’t think I’ve ever set the ‘nice’ level for a single thread inside my code. My point is, the snappiness is a result of decent system-wide adherence to a priority API more than the heterogeneous chip design. The low power consumption of course relies on both.
- sizzle 6y agoWill M1 silicon make the jump to iPhone/iPad in the future?
- eyesee 6y agoThe latest iPad Pro does use M1. It's more accurate to say that M1 made the jump from the A14 chips already in iPhones, as it's an enhanced variation of that design.
- api 6y agoIt's much faster even if you max out all cores. This may be part of it but the chip is objectively faster. Lots of Intel damage control these days. AMD is kicking their butt from one side and ARM from the other.
- whywhywhywhy 6y agoWorth keeping in mind all mac users are going from underpowered Intel processors running in a terrible thermal environment for them too. My 2018 USB-C MBP honestly feels like trash at times, just feels like every part of it is choking to hold the thing up.
- kortex 6y agoQuestion for the peanut gallery: In a -nix OS system, let's say single-threaded process is running on core 0. It makes a syscall. Does core 0 have to context-switch in order to handle the syscall, or could the kernel code run on core 1? This would allow a process to run longer without context switching and cache dumping, which would improve performance (as well as potentially security). Corollary question: could one make a kernel-specific core and would there be benefit to it? Handle all the I/O, interrupts and such, all with a dedicated, cloistered root-level cache.
- LightG 6y ago"A peanut gallery was, in the days of vaudeville, a nickname for the cheapest and ostensibly rowdiest seats in the theater, the occupants of which were often known to heckle the performers.[1] The least expensive snack served at the theatre would often be peanuts, which the patrons would sometimes throw at the performers on stage to convey their disapproval. Phrases such as "no comments from the peanut gallery" or "quiet in the peanut gallery" are extensions of the name.[1]" https://en.wikipedia.org/wiki/Peanut_gallery https://en.wikipedia.org/wiki/Peanut_gallery
- mousepilot 6y agoPosts like these are the gems that I come to HN for, as much as I've used the phrase, I never considered the source of it. I'd imagine I'd be in the cheap seats as well. Thanks!
- benlivengood 6y agoCross-core interrupts and syscalls are slow. The caches for any memory to be transferred have to be flushed on the calling core and its APIC would have to interrupt the destination core to start executing the syscall, which means entering kernel mode on the calling core to get access to the APIC in the first place. If the goal is low latency then staying on a single core is almost always better. To effectively use multiple cores requires explicit synchronization such as io_uring which uses a lock-free ring buffer to transfer opcodes and results using shared buffers visible from userspace and the kernel. io_uring has an option to dedicate a kernel thread to servicing a particular ring buffer, and this can also be limited/expanded to a set of cores. I have zero experience with io_uring in practice and so I don't know what a good tradeoff is between servicing a ring buffer from multiple or single cores. The entries are lightweight and so cache coherency probably isn't too expensive and so for a high CPU workload that also needs high throughout allowing other cores to service IO probably makes sense. I think newer x86_64 chips also allow assigning interrupts from specific hardware to specific cores to effectively run kernel drivers mostly on a subset of cores, or to spread it to all cores under heavy I/O.
- yepthatsreality 6y agoZoom! Zoom! Look at my first world computation speeds!
- martin_drapeau 6y agoI love the fact that Apple prioritizes the human over the machine. I always felt that iPhones and iPads felt faster than desktops. I reckon the QoS strategy is the reason.
- valbaca 6y agoI have a 2020 Intel Macbook from work and a M1 Macbook for personal use. Granted I put my work laptop under more load (compiling, video chats at work) but it just feels like a normal laptop. I feel it take its time loading large programs (IDEs) and the fan clicks on when I'm doing big compiles. I use my personal laptop for occasionally coding, playing games, and also video chats. But the M1 feels amazing. It's fast, snappy, with long battery life, and I've had it for several weeks and I never hear the fan. Even playing Magic Arena AND a Parallels VM runs silent. Arena alone turns my wife's Macbook Air into a jet turbine. It makes video chats so much nicer because it's dead silent. I've run into occasional compatibility issues with the M1. sbt not working was the latest bummer. So while my two laptops are technically a year apart, they feel like 5 years apart. The M1 laptop lives up to the hype and I'm glad to just have a laptop that's fast, quiet, has great battery, and is reliable. Edit: More context, I had bought a maxed-out Macbook Air last year hoping it would be my "forever-laptop" but it was just not giving me the speed I wanted, and the noise was just too much. I couldn't play any game or do any real coding in the living room without disrupting my wife enjoying her own games or shows. I'm so glad I traded up to the M1
- gketuma 6y ago"I never hear the fan. Even playing Magic Arena AND a Parallels VM runs silent." That is because there is no fan.
- EricE 6y agoHa - from another HN thread: https://fabiensanglard.net/lte/index.html https://fabiensanglard.net/lte/index.html
- lars512 6y agoI would kill to pin Dropbox to efficiency cores like this. Half the time when my fans are whirring I discover it's just Dropbox frantically trying to sync things.
- jtriangle 6y agoThere are plenty of self-hosted dropbox alternatives that don't do that. I get that not everyone is a "take matters into their own hands" kinda person, but it's worthwhile to at least look into it and see if it's something worth pursuing for you.
- ajkblue 6y agoMaestral (https://github.com/SamSchott/maestral https://github.com/SamSchott/maestral) is a pretty light-weight Dropbox client that works well for mac
- andrekandre 6y agoThe Time Machine backup pictured above ran ridiculously slowly, taking over 15 minutes to back up less than 1 GB of files. Had I not been watching it in Activity Monitor, I would have been completely unaware of its poor performance. Because Macs with Intel processors can’t segregate their tasks onto different cores in the same way, when macOS starts to choke on something it affects user processes too. this is really smart, and makes one wonder why intel didnt have the insight to do something like that already.... is this the result of thier "missing the boat" on smartphone processors (a.k.a giving up xscale)??
- sscarduzio 6y agoYeah cool, it's fast. But why so little RAM? Virtualisation and other professional software must be already a pain to run due to the ARM architecture, so why adding a memory handicap to it?
- Arcuru 6y agoInteresting, the article isn't clear how it's implemented and whether they dynamically adjust the QoS/Core, so I wonder if they solved the inversion problem. Basically you don't want a high-priority process to be dependent on a lower-priority process that's locked on a LITTLE core. Windows solves this by placing basically everything onto the LITTLE cores, and user interactions serve as a priority bump up to the big cores. The key (which is difficult to implement in practice) is that they pass that priority along to every other called thread in the critical path so that every path necessary to respond to the user can be placed on the big cores. This means that if you are waiting for a response from the computer, every thread necessary to provide that response, including any normally low-priority background services, is able to run on the big cores. I'd expect all the other OS's do a similar optimization for the big.LITTLE architectures. It seems to be the natural solution if you've worked in that space long enough.
- comex 6y agoAs of recently, macOS does support priority inheritance for a bunch of synchronization primitives [1], ranging from pthread mutexes to Mach IPC. But it's not perfect. For instance, read-write locks currently don't support priority inheritance, though they could. More problematically, when userland processes use any kind of custom synchronization scheme based on condition variables or similar, there's no way for the kernel to know which thread is expected to signal the condition variable and thus should inherit priority. That includes when libraries implement their own mutexes on top of that [2]... [1] https://opensource.apple.com/source/xnu/xnu-4903.241.1/osfmk/kern/turnstile.h.auto.html https://opensource.apple.com/source/xnu/xnu-4903.241.1/osfmk... [2] https://github.com/Amanieu/parking_lot/issues/205 https://github.com/Amanieu/parking_lot/issues/205
- why_only_15 6y agoYou should look into libdispatch, in my understanding, essentially everyone is expected to use libdispatch, and it may have something special to somehow help with priority inheritance.
- 6y ago
- otikik 6y agoDocker doesn't feel "faster than Intel" on Mac, does it? And it certainly lags behind on features.
- fomine3 6y agoHow it scheduled is interesting, but I wonder is the feeling really related to the core scheduling.