Performance issue with parsing large Data in parallel using Swift Concurrency

As I understand it, OSSA stands for Ownership SSA - it is a form of SIL which includes ownership information and allows for better ARC optimisations.

@Michael_Gottesman gave a talk about it: https://www.youtube.com/watch?v=qy3iZPHZ88o

In a thread from about 1.5 years ago (ARC overhead when wrapping a class in a struct which is only borrowed) I had some retain/release pairs that weren't being optimised, and passing -enable-ossa-modules removed them. Since then, whenever I see ARC issues, I pass that flag and very often it will improve things (not always, but it's definitely much more capable at optimising ARC operations).

Unfortunate that it wasn't able to help in this case.

I don't ship anything built with the flag enabled, but it's useful when I'm asking myself "is this something I can realistically expect the compiler to optimise? Or should I try to restructure my code somehow?"

5 Likes