News for hackers. Stuff that matters.
Re:Apple Silicon M1: Black Magic Fuckery by Twisell on Wednesday November 25, 2020 @05:06AM (#25207622)
From the original article:

Third, Marcel Weiher explains Apple’s obsession about keeping memory consumption under control from his time at Apple as well as the benefits of reference counting:

>where Apple might have been “focused” on performance for the last 15 years or so, they have been completely anal about memory consumption. When I was there, we were fixing 32 byte memory leaks. Leaks that happened once. So not an ongoing consumption of 32 bytes again and again, but a one-time leak of 32 bytes.

>The benefit of sticking to RC is much-reduced memory consumption. It turns out that for a tracing GC to achieve performance comparable with manual allocation, it needs several times the memory (different studies find different overheads, but at least 4x is a conservative lower bound). While I haven’t seen a study comparing RC, my personal experience is that the overhead is much lower, much more predictable, and can usually be driven down with little additional effort if needed.

Re:Apple Silicon M1: Black Magic Fuckery by kllrnohj on Wednesday November 25, 2020 @08:19AM (#25208883)
But again that didn't change with M1. We're talking MacOS vs. MacOS here. Your quote is fully irrelevant to what's being discussed which is the outgoing 32gb macbook vs the new 16gb-max ones. They are running the same software. Using the same ObjC & Swift reference counting systems.
Re:Apple Silicon M1: Black Magic Fuckery by Twisell on Wednesday November 25, 2020 @10:25AM (#25210145)
We've run full circle there

ARC is not specific to M1, BUT have been widely used in ObjC & Swift for years AND is thus heavily optimized on M1 that perform "retain and release" way faster (even when emulating x86)

Perfect illustration of Apple software+hardware long term strategy.

Re:Apple Silicon M1: Black Magic Fuckery by nemothekid on Wednesday November 25, 2020 @11:56AM (#25211312)
That still doesn't mean that M1 Macs use less memory. If retain/release is faster then the M1 Macs have higher performance than Intel Macs. That is easily understood. The claim under contention here is that M1 Macs use less memory, which is not explained by hardware optimized atomic operations
Re:Apple Silicon M1: Black Magic Fuckery by Twisell on Wednesday November 25, 2020 @04:26PM (#25214478)
And I never stated that. It's just more optimized.
Re:Apple Silicon M1: Black Magic Fuckery by nemothekid on Wednesday November 25, 2020 @04:55PM (#25214715)
Ok. However the posts in this thread were asking how the M1 Macs could use less RAM than Intel Macs, not if they were more optimized. The GP started with:

>This quote doesn’t really cover why M1 macs are more efficient with less ram than intel macs? You’ve got a memory budget, it’s likely broadly the same on both platforms

Re:Apple Silicon M1: Black Magic Fuckery by Twisell on Wednesday November 25, 2020 @05:21PM (#25214936)
Well, if less memory is used to store garbage thanks to RC, less memory is needed. But that was largely discussed in other sub-comments hence why we focused more on the optimisation aspect in this thread.
Re:Apple Silicon M1: Black Magic Fuckery by nemothekid on Wednesday November 25, 2020 @05:24PM (#25214959)
>Well, if less memory is used to store garbage thanks to RC, less memory is needed

But both Intel Macs and ARM Macs use RC. Both chips are running the same software.

Re:Apple Silicon M1: Black Magic Fuckery by ajuc on Wednesday November 25, 2020 @05:47AM (#25207859)
Aren't most big desktop apps like office on PC still written in C++? Same with almost all AAA games. And the operating system itself.

Browsers are written in C++ and javascript has full-blown GC.

I don't see how refcounting gives you advantage over manual memory management for most users.