4 ms·
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
by Twisell 6y ago
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.
- ajuc 6y agoAren'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.
- kllrnohj 6y agoBut 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.
- Twisell 6y agoWe'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.
- nemothekid 6y agoThat 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
- Twisell 6y agoAnd I never stated that. It's just more optimized.
- nemothekid 6y agoOk. 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
- Twisell 6y agoWell, 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.
- nemothekid 6y ago>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.