On 05/11/18 01:49, John Carter wrote:

> For example, what optimization flags (for compiling the unit tests) have
> been found helpful? 

What flags are you using at the moment, for your unit tests?

I have tended to use -Og -g as a reasonable tradeoff between debuggability
and performance (which is its intended aim anyway).  With gcc this works
quite well.  I've had more mixed performance results with clang using -g -Og.

Probably the most important thing is to avoid building your test cases with
-O0 (that is, no optimisation at all).  That causes gcc, at least, to produce
very poor code, involving many unnecessary memory references, which makes
Memcheck run very slowly.  Even -Og, which is the least level of optimisation
one can ask for above "none", drastically reduces memory traffic and
thereby makes Memcheck run significantly faster.

J


_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to