I get the feeling that the “ARC is great because you don’t have to deal with garbage collection pauses!!!” people have never had to close a 20 GB Instruments trace
“But it’s deterministic when the deallocations happen!” yeah I can see that clicking the red x made the app hang for 30 seconds, cool. In a generational GC I would have surely been mystified what caused the pause 10ms after I closed the document
(Actually I would expect that the garbage collection pass would bail out before long and reschedule the remaining work for the next pause, whereas ARC basically requires deallocation to occur now…)

@saagar GC uses more memory, and using more memory is just a loan on memory you don’t have on a phone.

I despise GCS. (Sorry Miguel).

At the end of the day you use refcount only if you have shared references (and hopefully swift will grow increasingly better at understanding borrows)

@madcoder My scalding hot take for today is that “we don’t have enough memory for a GC on a phone” is a boomer Apple engineer opinion from the 2010s

@saagar you’re entitled to your incorrect opinions :p

For an app maybe. For the system, absolutely not

@madcoder The part I left out because I figured it would make you more upset was “everyone shipping JavaScript apps these days is going to make the decision for you anyways whether you like it or not”
@saagar ouch. You had to go there.

@saagar but I did carve out the “for apps”. There are an order of magnitude (or more) more processes than apps on a typical system (electron apps don’t count here, they have too many processes themselves and are an abomination, fortunately, not on phones).

A GC on the system by default would cost you a lot. Way more than we deem acceptable.

@madcoder (Simmering down a bit, but still warm take) You’re not trying hard enough, Android shows what you can get when you train your shared cache engineers towards how to amortize garbage collectors
@madcoder If you control the entire language btw you can ensure that most things don’t even become garbage in the first place
@saagar it’s even worse with JS because you also pay the JIT tax (code is dirty memory and not shared, one of the reasons I absolutely dislike Java)
@madcoder Once again, you aren’t thinking hard enough ;) You can AOT compile most of the system image and map it across multiple processes
@madcoder Code pages for a specific app are of course not shared but you’re falling back to a binary for all cold paths anyways, so the actual live set of dirty pages that are not from disk can be tuned to be pretty small