News for hackers. Stuff that matters.
Re:Bubble sort slower with -O3 than -O2 with GCC by jleahy on Sunday October 17, 2021 @02:52PM (#28898770)
It’s a shame that Osize can sometimes produce truly awful code. There are a few optimisations in there that trade a byte for a massive slowdown.
Re:Bubble sort slower with -O3 than -O2 with GCC by userbinator on Sunday October 17, 2021 @04:46PM (#28899649)
You asked for minimum size, and that's what you got. I'd say that's working as it should.

A more granular control over optimisation would be good, however.

Re:Bubble sort slower with -O3 than -O2 with GCC by jleahy on Monday October 18, 2021 @08:07AM (#28904566)
Probably just some tweaks to O2 would be enough, after all people are selecting Os over O2 because they see better performance, and that should not be happening.
Re:Bubble sort slower with -O3 than -O2 with GCC by kevin_thibedeau on Sunday October 17, 2021 @07:31PM (#28900683)
You can enable/disable individual optimizations. How much more granular do you need?
Re:Bubble sort slower with -O3 than -O2 with GCC by jhgb on Sunday October 17, 2021 @04:15PM (#28899409)
Surely a profile-guided build should be able to only apply -Os to those functions where it doesn't cause a lot of problems.
Re:Bubble sort slower with -O3 than -O2 with GCC by pclmulqdq on Sunday October 17, 2021 @07:07PM (#28900578)
In the application I referred to, PGO was also used. However, that only applies -Os to cold code, and if what you're doing is very branchy, it can help even in the hot path.