3 ms·
> My recent tests with -Os resulted in distinctly negative effects on performance. Err... yeah, because -Os means "optimize size". Not "speed". > But the main
by junon 5y ago
> My recent tests with -Os resulted in distinctly negative effects on performance.
Err... yeah, because -Os means "optimize size". Not "speed".
> But the main problem with -Os is that it is poorly exercised
No, the main problem is that you don't understand -Os :) It works as intended.
- ncmncm 5y agoEvidently you are unaware that use of -Os has on earlier (but quite recent) generations of CPU architecture resulted in notably faster performance. And, that any compiler feature that is little used will necessarily receive less attention than commonly used features, and be less stable and reliable. Before trying to fix any bug in a program built with -Os, reproducing it first in -O2 will reduce premature balding.
- junon 5y ago> Before trying to fix any bug in a program built with -Os, reproducing it first in -O2 will reduce premature balding. I have no idea what you're talking about. Debug your programs in -O0, which means "no optimizations". -Os is, and has always been, optimizing for executable SIZE. It has no guarantees wrt performance.
- ncmncm 5y ago> "I have no idea what you're talking about" At least you got that right. Slow down and think a bit before posting, and you will post fewer foolish things to regret. It is quite rare these days to actually care about a few percent savings of binary size, outside of deeply resource-constrained embedded environments, which are increasingly rare. But many people not building for such circumstances developed a habit of using -Os because it also, on older hardware, made their programs faster. It is helpful for those people to learn that this trick is decreasingly useful for their intended purpose. If you are not one of them, the original remark was not addressed to you. Assuming you know better than everybody else you have contact with will continue causing you difficulties in life, frequently without your knowledge. Stopping to think and listen will likewise pay dividends you cannot count.
- junon 5y agoPlease debate in good faith instead of resorting to snide remarks. Os has never made any guarantees of speed or performance. Any cases where performance increased over O2 are platform specific and are anomalous. I've never made any statement on edge cases, only guarantees and intent. I have nothing to regret.