|
|
|
|
|
by neonsunset
638 days ago
|
|
> it's that it has to read memory more often Wait until you learn about "reads become writes with ARC" :) ARC as implemented by Swift, on top of ObjCs retain and release, is design that has an advantage in being more simple, but at the same time worse at other key aspects like throughput, contention, memory traffic and sometimes even memory efficiency. Originally, Swift was meant to use GC, but this failed because Apple could not integrate it well enough with existing Objective-C code, leading to a very crash-prone solution. Also, JavaScript has nothing to do with the lower in abstraction languages discussed in this chain of comments. |
|
> reads become writes with ARC
That's not a big problem (it is a problem but a smaller one) since you can choose a different tradeoff wrt whether you keep the reference counting info on the same page or not. There's other allocator metadata with the same issue though.
A more interesting one comes up with GC too; if you're freeing all the time, everyone compresses their swap these days, which means zeroing the freed allocations is suddenly worth it because it compresses so much better.
> Originally, Swift was meant to use GC, but this failed because Apple could not integrate it well enough with existing Objective-C code, leading to a very crash-prone solution.
It was Objective-C that had the GC (a nice compacting one too) and it failed mostly for that reason, but has not come back because of the performance issues I mentioned.
> Also, JavaScript has nothing to do with the lower in abstraction languages discussed in this chain of comments.
Oh, people definitely want to use it in the same places and will if you don't stop them. See how everyone's writing apps in Electron now.