User forums > General (but related to Code::Blocks)
Quick&dirty C++ language conformance tests
Ceniza:
-O2 to the linker? 18%? I just tried that and the filesize is still the same.
-Wl,-O2
Am I missing something?
thomas:
--- Quote from: Ceniza on December 17, 2005, 04:45:59 pm ----O2 to the linker? 18%? I just tried that and the filesize is still the same.
-Wl,-O2
Am I missing something?
--- End quote ---
I don't know really, lol. When I read that in the manpages, I immediately tested it, and it turned a 802kB app into a 658kB app, which made me go "wowww!". I then tried recompiling wxWidgets in that manner, but it did not seem to make a difference (although I am not sure whether or not I did it correctly. You know compiling wxWidgets is not precisely intuitive...). And since building wx takes forever, I did not bother any further. So far my experience with it.
Personally, I have currently no need to squeeze every bit out of my applications, so I prefer the linker running faster instead :)
But still, there is more in it than the eye meets.
Although I don't know how the linker optimizes at all, I guess it is mostly useful on large executables because you have the minimum overhead of 4k due to sections (at least using PE, don't know the limits of ELF) which is less noticeable the bigger the executable is, and because most likely "optimize" means dead-stripping unused code and playing with function alignments where it does not break anything.
The most notable thing, however, is that nobody (including myself) ever reads the documentation (yes, reading documentation sucks almost as much as writing), but everybody thinks he knows the tools he is using.
And then one day after many years, you discover that you don't know anything at all... I have half an hour of reading documentations on my daily schedule now :)
Urxae:
--- Quote from: thomas on December 17, 2005, 05:18:05 pm ---
--- Quote from: Ceniza on December 17, 2005, 04:45:59 pm ----O2 to the linker? 18%? I just tried that and the filesize is still the same.
-Wl,-O2
Am I missing something?
--- End quote ---
I don't know really, lol. When I read that in the manpages, I immediately tested it, and it turned a 802kB app into a 658kB app, which made me go "wowww!". I then tried recompiling wxWidgets in that manner, but it did not seem to make a difference (although I am not sure whether or not I did it correctly. You know compiling wxWidgets is not precisely intuitive...). And since building wx takes forever, I did not bother any further. So far my experience with it.
Personally, I have currently no need to squeeze every bit out of my applications, so I prefer the linker running faster instead :)
But still, there is more in it than the eye meets.
--- End quote ---
I have noticed that in code containing a lot of template instantiations (in my case, anything non-trivial using Boost.Spirit) using optimizations can really reduce linker times. My guess is that inlining removes a lot of symbols that the linker would otherwise have to check for duplicates etc. It may be helped by the fact that the linker uses less memory and doesn't need to swap as much.
Ceniza:
--- Quote from: thomas ---And since building wx takes forever...
--- End quote ---
real 6m26.734s
user 2m59.290s
sys 1m25.821s
I find it quite acceptable, even more when real becomes closer to user :)
me22:
--- Quote from: Michael on December 16, 2005, 02:45:09 pm ---I have found this website which provides quick&dirty C++ language conformance tests for the Win32 platform. As C::B supports them, this website could be useful for deciding which compiler is best suitable for a specific project.
--- End quote ---
Gotta love that of the C++ tests, MinGW ( not even native g++ ) only fails 2, one of which is "throwing destructor" which you shouldn't ever be using anyways.
And what a surprise, the old mingw fails C++0x extension tests *rolls eyes*
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version