]> git.ipfire.org Git - thirdparty/valgrind.git/commit
patch that improves the speed of the leak search by up to 40% (on amd64)
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 18 Jul 2012 22:26:51 +0000 (22:26 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Wed, 18 Jul 2012 22:26:51 +0000 (22:26 +0000)
commit67f15ef8717b3926fb675c04b5f06838bd2dd6a6
tree7b4ffa421e1b193e5cf47d408267682fa665918a
parent0dcfe28c77a732632a64550bb2945dccd77e14c6
patch that improves the speed of the leak search by up to 40% (on amd64)

Scanning 1GB of random values made of 200_000 malloc-ed block is
(on amd64) changing from (about) 17 seconds to (about) 10 seconds.

On x86, it goes from 153 seconds to 129 seconds.

(this huge difference between x86 and amd64 leak search time
for this random test is because a random value has about one chance
on 4 to be in the addressable memory on x86 and so the dichotomic
search in the list of malloc-ed blocks is called for a lot more
values than on amd64).

Basically, there are 3 optimisations:
1. call MC_(is_within_valid_secondary) only at the beginning of a
   secondary map (and not for each Word).
2. call SETJMP only at the beginning of a page (and not for each Word)
3. Validate an aligned word using get_vabits8 rather than get_vabits2.

Each of the above optimisation more or less improves by 2 seconds.
(to go from 17 seconds to 10 seconds).

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12756
NEWS
memcheck/mc_leakcheck.c
memcheck/mc_main.c