|
From: M. C. <mma...@gm...> - 2018-06-11 19:54:46
|
Hi Philippe, Thank you for the quick response. The problem that we're facing is that our `clang Valgrind` builds are taking a lot more time than our `gcc Valgrind` ones, and we are using `-O1` for the both of them, the time difference between the two has become intractable. We have a lot of configs that we're testing our project with: https://drake-jenkins.csail.mit.edu/view/Nightly%20Production/ Yes, I was referring to the quick-start section. Using `-O2` would solve our problem, but since it is explicitly not recommended: > Use of -O2 and above is not recommended as Memcheck occasionally reports uninitialised-value errors which don't really exist. we didn't want to use it. Thank you, Mmanu Chaturvedi On Mon, Jun 11, 2018 at 3:14 PM, Philippe Waroquiers < phi...@sk...> wrote: > I guess that what you mean by 'highest suggested optimization level' is > the recommendation to use -O0 or -O1 in the 'quick-start', in the section > "2. Preparing your program". > > In my opinion/in my experience, the advice to use -O1 is obsolete: > I routinely use valgrind on -O2 compiled code, without particular > problems. > > And in any case, what -O1/-O2 give for gcc and clang is not > the same, and I do not see why they would be the same, > and why you would like to obtain comparable speed. > Having different speed between gcc and clang compiled code is > normal (except > maybe for the compiler writers, > if they see a huge inefficiency for some code at > whatever optimisation > level). > > My advice: just compile your program the way you want, > and run valgrind/memcheck on it :). > If you want to use valgrind/callgrind, better compile it with the > options with which you will deliver your program (so > probably with some level of optimisation). > > Maybe the above does not really answer to your question, but > then you should indicate more precisely the problem you want to > solve, like: > 'I am trying to do .... with valgrind > and I obtain the strange behaviour of ...' > > Philippe > > > On Mon, 2018-06-11 at 11:27 -0400, M. Chaturvedi wrote: > > Hi, > > > > The highest suggested optimization level for Valgrind seems to be > `-O1`. What we are seeing is that clang runs much slower with `-O1` than > gcc (~3x), even without Valgrind, and with Valgrind, the difference is > considerable. To reproduce: > > > > https://github.com/m-chaturvedi/test_valgrind_slowdown > > > > I have asked the question of how can I make clang and gcc of comparable > speeds on LLVM and gcc mailing lists to no avail. > > > > I was wondering if folks at Valgrind would have any suggestions about > it, perhaps if there are any compiler wise difference in the highest > optimization level one could use without affecting the results much? > > > > GCC: https://gcc.gnu.org/ml/gcc-help/2018-06/msg00023.html > > LLVM: http://lists.llvm.org/pipermail/llvm-dev/2018-May/123708.html > > > > > > Thanks, > > Mmanu Chaturvedi > > > > > > > > ------------------------------------------------------------ > ------------------ > > Check out the vibrant tech community on one of the world's most > > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > > _______________________________________________ > > Valgrind-developers mailing list > > Val...@li... > > https://lists.sourceforge.net/lists/listinfo/valgrind-developers > |