[Gllug] code optimisations

Daniel P. Berrange dan at berrange.com
Sun Mar 20 19:44:36 UTC 2005


On Sun, Mar 20, 2005 at 12:04:26PM +0000, Minty wrote:
> *** gprof **********
> 
> I had the source.  So I ran gprof.  I spotted one function taking 65%
> of the time.  This particular code was a lot of churning through
> arrays.

I can whole heartedly recommend giving OProfile a try out - it fills the
same primary use case as gprof but has a number of really compelling
extra capabilities

 * No need to compile your code with extra flags - it runs against
   standard built binaries, although presence of debugging symbols
   will allow finer grained examination
   
 * Profiling samples can be collected & correlated across the app
   binary, shared libraries, and the kernel calls the app makes.
   I've found collation of samples into kernel space really useful,
   for example on one app i profiled it turned out that 80% of the
   time was being spent in one particular kernel function, which
   we eventually diagnosed as being caused by memory I/O bandwidth 
   being maxed out.

 * You can profile more than just execution time, for example you can
   collect samples against branch prediction hit / miss, l1/l2/l3
   CPU cache hit / miss rates, and all manner of CPU events. Since the
   samples are collected using a non-maskable interrupt handler, you
   don't get any black spots in your data from times where interrupts
   are disabled on the CPU.

Check out their website,

  http://oprofile.sourceforge.net/

Or for some real world examples, Will Cohen has written a number of
tutorials / articles using oprofile on Fedora Core

  http://people.redhat.com/wcohen/

Regards,
Dan.
-- 
|=-            GPG key: http://www.berrange.com/~dan/gpgkey.txt       -=|
|=-       Perl modules: http://search.cpan.org/~danberr/              -=|
|=-           Projects: http://freshmeat.net/~danielpb/               -=|
|=-   berrange at redhat.com  -  Daniel Berrange  -  dan at berrange.com    -=|
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
URL: <http://mailman.lug.org.uk/pipermail/gllug/attachments/20050320/94bbc06f/attachment.pgp>
-------------- next part --------------
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug


More information about the GLLUG mailing list