The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

Compiler optimisation flags

I did a little experiment to see what effect VS2005/GCC compiler optimisation flags had on the genetic algorithm in my software. The results are here if anyone is interested:

http://successfulsoftware.net/2007/12/18/optimising-your-application/

I am wondering how robust these results are across different PCs and application areas (e.g. heavy floating point calculations). Has anyone tried something similar and got different results?
Andy Brice Send private email
Tuesday, December 18, 2007
 
 
As you yourself mentioned in the article, "Measuring is the only way to tell".

In my experience, people tend to prefer using rules-of-thumb rather than actually "measuring".  So I haven't seen a whole lot of use of Profilers.

I'd be surprised if there were any "common" results, though.  I believe Compiler Technology, especially the optimizations used, tend to change from release to release and vendor to vendor.

Still, knowing the results of other such "comparative" studies would be useful.
AllanL5
Tuesday, December 18, 2007
 
 
Here's a recent thread about compiler flags related to std::vector in C++. 

http://groups.google.com/group/comp.lang.c++/browse_thread/thread/af2a8e55f9551c8f

Take homes: measure, and read the documentation.
Michael Gibson Send private email
Tuesday, December 18, 2007
 
 
Interesting. I am surprised that _SECURE_SCL is defined by default. But I don't use STL myself.
Andy Brice Send private email
Tuesday, December 18, 2007
 
 
Something else to not forget when trying to squeeze performance out of your compiler.  At least in VS there are code decorations you can add like no alias and restrict. declaring a function noalias tells the compiler that your pointers don't alias and so they can be optimized better.  restrict tells the compiler that the function is pure and doesn't modify global state.
Brian
Saturday, December 22, 2007
 
 
Andy Brice> Most of the optimisation between od and o1 comes from not adding the debug code & checks I believe.

Regarding std::vector: it should be slower than using bare pointers. One thing that jumped at me in the example is postincrementing iterators (this may or may not be optimized away). Anyway, profiling really is the best idea in these cases.
to_be_defined
Wednesday, December 26, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz