-1

My app freezes in Release configuration only.
I tracked down the issue to this setting:

enter image description here

It is no secret that the Swift compiler is buggy. I have never seen a compiler crash (and crash often).

So, is it "safe" to submit to the App Store with Optimisation Level set to "None"?
Any experience?

1 Answers1

1

Apple does not recommend shipping your application with no compiler optimizations.[1]

None: The compiler does not attempt to optimize code. Use this option during development when you are focused on solving logic errors and need a fast compile time. Do not use this option for shipping your executable.

Taken from apple.developer.com.

While compiler optimization bugs exist,[2] Xcode is probably not the source of the problem, as explained in the answer provided here by the stackoverflow user @kfmfe04:

In some extremely rare cases, the debug code works, but the release code fails. When this happens, almost always, the problem is in my code; aggressive optimization in release builds can reveal bugs caused by mis-understood lifetimes of temporaries, etc...


Remember that you can always track down the source of the problem by examining the compiled assembly file, but it will require some ASM knowledge to understand what the compiler is doing under the hood.

In Xcode options:

Debug -> Debug Workflow -> Always Show Disassembly

Then you put a breakpoint where you want to check the ASM code.

Community
  • 1
  • 1
Tiago Marinho
  • 2,146
  • 17
  • 37
  • However, Apple also recommends to ship apps that do not freeze. – Nick Kanellopoulos May 22 '16 at 09:25
  • You were asking about what is "safe" to do. Submitting your application with no compiler optimizations will probably get it rejected. – Tiago Marinho May 22 '16 at 09:28
  • I am asking if someone has had experience with submitting a build without optimisations. This could be my only option if I do not find the cause of the problem. And the source of the problem is probably in a library I am using. – Nick Kanellopoulos May 22 '16 at 09:43
  • @NickKanellopoulos sure, just keep in mind that while Apple may let your app pass by to appstore, this setting is a poor option for your users. This will make your app considerably slower and bigger. – Tiago Marinho May 22 '16 at 09:49