uber / needle

Compile-time safe Swift dependency injection framework
Apache License 2.0
1.84k stars 144 forks source link

Very high compile times in release mode for our largest app #441

Closed rudro closed 1 year ago

rudro commented 2 years ago

It's unclear if this issue has been around for a while or it's new in Swift 5.7/Xcode 14. We only just noticed this issue.

For our latest app, the Uber rides app, the needle generated code take over an hour to compile in Release (i.e. -Osize) mode. The issue is demonstrated in a toy project and reported here : https://github.com/apple/swift/issues/62124

The workaround for this is to add a @inline(never) to some of the functions. Until the compiler performance issue is fixed, we should use this workaround in the needle generated code.