Re: -O3 vs. -Os
Re: -O3 vs. -Os
- Subject: Re: -O3 vs. -Os
- From: Stefan Werner <email@hidden>
- Date: Tue, 17 Jan 2006 23:08:39 +0100
Because OO languages often have accessors, for any given algorithm,
they are likely to call more functions than say, C. Yet with higher
optimization, the compiler can inline most of those small-function
calls, especially accessors.
Especially when taking advantage of C++ features like operator
overloading, -O3 and function inlining can make a huge difference.
Imagine using a C++ class representing a vector, and you use operator
overloading for cross and dot product, rotations, etc. Or take
OpenEXR for example, it's implementing a half precision floating
point class in 16 bits. Without inlining, such code becomes
incredibly slow.
Stefan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden