@inlinable performance example

Thanks! Interesting discussion. Something like that would still be useful to me :)!

Can we get a confirmation if this information is outdated? What @Erik_Eckstein says in this post contradicts this information as of Swift 5.8.

That doesn't seem like a contradiction. If anything it's ambiguous since it's not clear whether the default conservative CMO is enabled for SPM. I would think not given @lukasa's previous statement. Most build settings don't propagate down SPM dependency chains, but it would be good to be definitive.

1 Like

I’d think it’s enabled by default as we ran into issues with our blackHole implementation when moving to 5.8+ - pure SPM. Details.

1 Like

To @Jon_Shier's point, there is no contradiction here. Default CMO may, at the discretion of the compiler, elect to make a function inlinable. But it does not make everything inlinable, and it is not under your control.

To that end, module boundaries remain effectively optimization boundaries. If you're fortunate, CMO may trigger, but if you wish to be certain, @inlinable remains necessary.

1 Like