Dave's Brain

Browse - programming tips - perl easy profile

Date: 2010may20
Language: perl
Keywords: profile, profiling, optimize, optimizing

Q.  Where is the time is going in my perl script?

A.  Use the DProf profiler like this:

	#!/bin/sh

	if [[ -f tmon.out ]]; then
		rm tmon.out
	fi

	perl -d:DProf $*

	if [[ ! -f tmon.out ]]; then
		exit
	fi

	dprofpp

	rm tmon.out

The file tmon.out is created by the first step and used by the second.

By default dprofpp only displays the 20 busiest routines.  You can
show more by doing:

	dprofpp -O 100
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: