Performance Pragmas

Would these be the correct pragmas to use to get the compiler to maximise performance over all else?

#If Not TargetWeb
  #Pragma DisableBackgroundTasks
#EndIf
#Pragma NilObjectChecking False
#Pragma StackOverflowChecking False
#Pragma DisableBoundsChecking

Any thing else that can be called upon?

Looks like you caught 'em all.

From the Xojo docs. http://documentation.xojo.com/api/language/pragma_directives.html

#If Not TargetWeb
  #Pragma BackgroundTasks False
#endif
#Pragma BoundsChecking False
#Pragma NilObjectChecking False
#Pragma StackOverflowChecking False

Keep in mind that the three “checking” pragmas mean that you must guard against those conditions or your app will crash even if you have an exception block or handler!

1 Like

Do I understand it correctly when you use those Pragma’s the Try-Catch does not work (and the app will crash)?

Yes

That is the whole point of the pragmas…

Your telling the compiler

“I know better I can optimize the error checks better my self for this specific code”

So if your code has error or you ignore some case then you will crash.

2 Likes