- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can i combine /Ox with /Os option?
1 Solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>...In my experience, for Qt based program, if you set
>> -fno-exceptions -fno-inline
>>it will help reducing executable size significantly.
.
Another option to consider is a 'hand-based' code optimization. On some projects developers simply do not care how many C/C++ code lines they have and some simple algorithms look like monsters ( thousands of lines instead of hundreds lines ).
Link Copied
7 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suspect, if you set both options, the latter one will suppress the first. /Os for ICL was documented as generating the minimum size binary with no effort to gain performance. /O1 would produce a slightly larger binary with most performance optimizations, except for auto-vectorization.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi everybody,
>>...Can i combine /Ox with /Os option?
No and this is because /Ox ( Full Optimization ) will override any other optimization option /On. It is very easy to verify and a warning message, like: '...overriding '/O1' with '/Ox'', should be displayed.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are my test small program written on Qt 4:
/Os = 104 kb
/O2 = 114 kb
/O2 /Os = 105 kb
/Os /O2 = 105 kb
/O3 = 114 kb
/O3 /Os = 105 kb
/Os /O3 = 105 kb
/Ox = 116 kb
/Ox /Os = 112 kb
/Os /Ox = 112 kb
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sergey Kostrov wrote:C:\Qt\qt-everywhere-opensource-src-4.8.3\examples\widgets\stylesheet>icl Intel(R) C++ Compiler XE for applications running on IA-32, Version 13.0.0.089 Build 20120731 In the course of the test (see results above) I have not received such messages
Hi everybody,
>>...Can i combine /Ox with /Os option?
No and this is because /Ox ( Full Optimization ) will override any other optimization option /On. It is very easy to verify and a warning message, like: '...overriding '/O1' with '/Ox'', should be displayed.
Best regards,
Sergey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
[SergeyK] I understood that you're on a Windows platform and here is a quote from 'Intel C++ compiler User and Reference Guides':
...
__ NOTE. On Windows systems, the /Od option is part of a mutually-exclusive group of
__ options that includes /Od, /O1, /O2, /O3, and /Ox. The last of any of these options
__ specified on the command line will override the previous options from this group.
...
[SergeyK] Please take a look at the document ( pdf or online ) because it has lots of details. For example, like:
...
__ The compiler enables maximum optimizations by combining the following options:
__ • /Ob2
__ • /Og
__ • /Oy
__ • /Ot
__ • /Oi
...
[SergeyK] In case of '/Os' option the document says:
...
This option enables optimizations that do not increase code size and produces smaller code
size than O2. It disables some optimizations that increase code size for a small speed benefit.
This option tells the compiler to favor transformations that reduce code size over transformations
that produce maximum performance.
...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In my experience, for Qt based program, if you set
-fno-exceptions -fno-inline
it will help reducing executable size significantly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
>>...In my experience, for Qt based program, if you set
>> -fno-exceptions -fno-inline
>>it will help reducing executable size significantly.
.
Another option to consider is a 'hand-based' code optimization. On some projects developers simply do not care how many C/C++ code lines they have and some simple algorithms look like monsters ( thousands of lines instead of hundreds lines ).

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page