Re: Valgrind runs way slower on faster PC

Paul Floyd via Valgrind-users <[email protected]> Tue, 11 Feb 2025 21:22:00 +0100
Newsgroups gmane.comp.debugging.valgrind
Message-ID <[email protected]>

On 10-02-25 09:44, Lev Yudalevich wrote:
> My first PC has i7-6700K @ 4.00GHz x 8 CPU, 32GiB RAM
> My second PC has i7-10700 @ 2.90GHz x 16 CPU, 64GiB RAM
> Both machines have identical OS installation (Ubuntu 22.04.5 LTS) rest 
> of the software (toolchains etc).
> However, running Valgrind (version 3.25.0.GIT) with the same test 
> program on a second (presumably more powerful) machine is more than 
> twice slower than running the same on the first machine. What can be a 
> reason for this? I'd really appreciate any hint/help/idea. Thank you. Lev.


Any patches to speed up Valgrind would be welcome ;-)


Seriously, one common mistake that I often see new users make is 
overdoing it with the Valgrind options. Just because Valgrind has many 
options doesn't mean that you should use them all. As a rule the more 
options you add the slower Valgrind will run.

I'm going to assume that it's memcheck that you are using.

If you're just running tests
----------------------------
Really minimise your use of options. You may need --trace-children=yes 
(and possibly --trace-children-skip= if your exe forks a lot of other 
processes), Don't check for leaks unless the leak summary says that you 
have leaks. Don't use --track-origins=yes until you have detected a 
"Conditional jump" error.

If you know you have an error and you want to debug it
------------------------------------------------------
This is where you want to start turning on options like
--track-origins=yes and --read-var-info=yes.

A+
Paul