0

I have an app I am working on that will be used in MacOS with Adobe products.

The SDK only comes with a debug release mode for the projects. If I try to edit the scheme and look under 'run', I cannot switch it to release as there is no other option either than debug. From what I've read, this means I either have to create a new scheme, or edit this one.

In Windows, compiling between debug and release mode produces a huge performance difference in the app so I assume the same thing happens in MacOS. For this reason, it is important for me to set the appropriate optimizations correctly. However, I have no idea which are important.

Does anyone have suggestions on what are the key optimizations I should set by either editing the debug mode, or creating a new one, for optimal performance from my app?

Thank you - I am a little blind in this department as I am a Windows developer and Mac is new to me.

Thanks, -Richard

Rich95
  • 199
  • 1
  • 3
  • 18

1 Answers1

0

To create a new scheme:

  1. Get the screen looking like the following screenshot:

enter image description here

  1. Click on '+' under where it says AppStore. This creates a duplicate of an existing scheme with a new name.

  2. Edit the newly created configuration with the desired compiler settings etc.

The newly created configuration should then show up in the 'Edit Schemes' window.


Edit: To set optimisation flags, get your screen looking like this and then select the flags you want for each configuration:

Set optimisation flags

I encourage you to experiment. None of this is difficult.

Paul Sanders
  • 24,133
  • 4
  • 26
  • 48
  • Hi Paul - thank you for this and it's helpful and helping me understand how to create a new scheme. But even more important is the question of what are the key optimizations one should set / change for a release mode compilation, for a MacOS app? – Rich95 Aug 24 '20 at 18:13
  • Where did your Xcode project come from? By default, Debug and Release configurations are created automatically when the project is created. – Paul Sanders Aug 24 '20 at 19:08
  • Added something to my answer. – Paul Sanders Aug 24 '20 at 19:25
  • Hi Paul - thanks for this. I will take a look. The project comes from the Adobe After Effects SDK. For some reason, it only comes with a debug mode so I am totally in the dark as to what settings I should use for release mode. Many have complained about its lack of documentation. – Rich95 Aug 24 '20 at 21:58
  • In Windows there is a huge performance difference between Debug and Release mode so this is what I am afraid of. Of course, perhaps that is not the case with Mac and perhaps there is no performance difference between debug and release mode on MacOS? – Rich95 Aug 24 '20 at 22:00
  • There's a difference. I typically find a 3x speedup, but sometimes more. – Paul Sanders Aug 24 '20 at 22:56
  • So you showed me where to change the optimization flags but I can't find info anywhere on which flags are important to adjust for release mode - especially those that will affect performance. Do you have any suggestions? – Rich95 Aug 24 '20 at 23:27
  • You can just use the ones in the screenshot. – Paul Sanders Aug 24 '20 at 23:29
  • Or see [here](https://clang.llvm.org/docs/CommandGuide/clang.html) (and search for **optimization level**). – Paul Sanders Aug 24 '20 at 23:42
  • Excellent! Your screenshot really helps! This is exactly the info I was hoping for. Thank you very much, Paul. I will also review the CLANG link you sent me. – Rich95 Aug 25 '20 at 00:04
  • Welc. Don't forget to vote for / accept helpful answers. – Paul Sanders Aug 25 '20 at 00:05
  • Well, after all that selecting a build optimization other than 'None' causes the app to immediately crash upon launch. I did some research and read that it could be any part of the code that plays nicely with no optimizations but not so with. My app is pretty huge and the chances of finding the offending code is probably NIL. So I guess my options are only to release as 'debug' mode which I assume is the same as optimizations set to 'None'. Is that a bad idea? – Rich95 Aug 25 '20 at 14:32
  • Well, it's not a bad idea per se, but you will be missing out. Does the debugger tell you anything? – Paul Sanders Aug 25 '20 at 15:17