Re:Apple’s M1 Positioning Mocks the Entire x86 Business Model
by skohan on Friday April 23, 2021 @07:41PM
(#26920580)
The worst case performance is very bad though. I have done some playing around with pushing Swift in terms of performance, and it's very hard because of ARC.
[ Parent
| on HN ]
Re:Apple’s M1 Positioning Mocks the Entire x86 Business Model
by foobiekr on Friday April 23, 2021 @08:18PM
(#26920841)
Code in the fastpath must not generate substantial garbage whether using ARC or a gc. That's just a coding error.
Re:Apple’s M1 Positioning Mocks the Entire x86 Business Model
by skohan on Saturday April 24, 2021 @10:36AM
(#26925120)
It's not about garbage creation, is about reference cost. With ARC, you pay a penalty every time you pass a reference type, not only for memory churn. You can avoid this using value types, but this often results in a lot of unnecessary copying.
It's not unavoidable, but Swift doesn't give good tools for avoiding ARC-based performance cliffs, so it takes a lot of profiling and effort compared to other languages.
Re:Apple’s M1 Positioning Mocks the Entire x86 Business Model
by astrange on Saturday April 24, 2021 @10:49PM
(#26929969)
It's ok to generate garbage if it goes away immediately; that's essentially a stack allocation. Performance problems come up when you have a mix of lifetimes. (that slows GCs down and causes heap fragmentation outside copying GCs)