On Fri, Apr 18, 2014 at 1:08 PM, Yuri Gribov <[email protected]> wrote:
>>> I wonder where such big difference is coming from. I'll examine perf
>>> when I finally get my hands on SPEC2006.
>>
>> You don't need SPEC,  just run something small like bzip2.
>
> Ok, good to know. Here are my results for bunzipping a vmtouched 100M file:
>
> gcc:
>   0m6.315s
>
> clang:
>   0m5.570s
>
> clang -fsanitize=address:
>   0m10.961s
>
> clang -fsanitize=address -mllvm -asan-instrumentation-with-call-threshold=0:
>   0m21.988s
>
> clang -fsanitize=address -mllvm -asan-outline-checks (my
> implementation, see attach):
>   0m17.345s
>
> So even though my implementation is slightly faster we're still
> getting a 70% perf hit.
interesting.

can you show the assembly (objdump -d) for __asan_load8 in both variants?

>
>> regular asan instrumentation requires 1 load.
>> a call, which itself does 1 load, costs two more loads (call and ret),
>
> Well, these memory accesses are always cached so I wouldn't expect
> them to hurt that much. May make sense to profile of course.
>
>> besides the call puts more pressure on the reg allocator which causes more
>> spills.
>
> This sounds reasonable. I wonder if using custom ABI for these
> callbacks would help - amd64 marks a lot registers (nine?)
> caller-saved whereas checking callbacks only need 3-4 regs on the fast
> path. Sadly GCC does not seem to provide generic infrastructure for
> custom ABIs.

If you want to rely on a custom ABI, you should implement in on both
callee and caller sides.
That might indeed improve the seed, but imho is not worth it here.

>
> -Y
>
> --
> You received this message because you are subscribed to the Google Groups 
> "address-sanitizer" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"address-sanitizer" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to