[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Some tips on profiling

From: Ramkumar Ramachandra <artagnon_at_gmail.com>
Date: Wed, 29 Sep 2010 14:15:20 +0530

Hi Philip,

Philip Martin writes:
> The performance of svnrdump is likely to be dominated by IO from the
> repository, network or disk depending on the RA layer. strace is a
> useful tool to see opens/reads/writes. You can see what order the
> calls occur, how many there are, how big they are and how long they
> take.

Ah, thanks for the tip.

> Valgrind/Callgrind is good and doesn't require you to instrument the
> code, but it does help to build with debug information. It does
> impose a massive runtime overhead.

I don't mind -- I'm mostly using some remote machines to gather the
profiling data :)

> This is what I get when dumping 1000 revisions from a local mirror of
> the Subversion repository over ra_neon:
>
> CPU: Core 2, speed 1200 MHz (estimated)
> Counted CPU_CLK_UNHALTED events (Clock cycles when not halted) with a unit mask of 0x00 (Unhalted core cycles) count 100000
> samples % app name symbol name
> 4738 41.1893 no-vmlinux (no symbols)
> 1037 9.0150 libxml2.so.2.6.32 (no symbols)
> 700 6.0854 libneon.so.27.1.2 (no symbols)
> 238 2.0690 libc-2.7.so _int_malloc
> 228 1.9821 libc-2.7.so memcpy
> 221 1.9212 libc-2.7.so memset
> 217 1.8865 libc-2.7.so strlen
> 191 1.6604 libsvn_subr-1.so.0.0.0 decode_bytes
> 180 1.5648 libc-2.7.so vfprintf
> 171 1.4866 libc-2.7.so strcmp
> 153 1.3301 libapr-1.so.0.2.12 apr_hashfunc_default
> 134 1.1649 libapr-1.so.0.2.12 apr_vformatter
> 130 1.1301 libapr-1.so.0.2.12 apr_palloc
>
> That's on my Debian desktop. At the recent Apache Retreat I tried to
> demonstrate OProfile on my Ubuntu laptop and could not get it to work
> properly, probably because I forgot about -fno-omit-frame-pointer.

Ah, now I see why it didn't work for me. The data from Callgrind is
very interesting- it seems to suggest that APR hashtables are
prohibitively expensive.

@Stefan: Thoughts on hacking APR hashtables directly?

> Finally there is traditional gprof. It's a long time since I used it
> so I don't remember the details. You instrument the code at compile
> time using CFLAGS=-pg. If an instrumented function foo calls into a
> library bar that is not instrumented then bar is invisible, all you
> see is how long foo took to execute.

Yes, I used gprof initially. Callgrind is WAY more useful.

-- Ram
Received on 2010-09-29 10:47:11 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.