Should the default optimization be for greater speed?


#1

Sorry for all the posts, a lot of tiny things have accumulated in the last few months, none of great import.

I was meaning to ask - the default optimization in the Introjucer is “smaller size”. Most of the time, I’m interested in “faster”…


#2

[quote=“TomSwirly”]Sorry for all the posts, a lot of tiny things have accumulated in the last few months, none of great import.

I was meaning to ask - the default optimization in the Introjucer is “smaller size”. Most of the time, I’m interested in “faster”…[/quote]

There’s a lot of information that, for a ‘normal’ app, smaller size is faster. That’s what Apple was saying a while ago, at least. The idea being loading the code pages in an out was more time than the actual processing.

Bruce


#3

Hah! Very interesting!

Perhaps there could be a little more information in the rollover for the “Optimisation” field in the Introjucer that mentioned this?


#4

TBH I’m not sure the default matters too much - I’d expect that anyone who gets as far as compiling a release build would have at least cast their eye over the settings page to make sure that it’s all the way they want it!


#5

Well, I did that of course, and switched it to “optimize for speed” - but it seems that I’m learning that this will make a binary that is both bigger and slower…!


#6

Optimize for speed will often employ tricks such as unrolling loops, which in theory is good but obviously increases the chance of cache misses.


#7

I would call that “optimising” for “speed”, if it in fact comes out slower. :smiley: