Dave's Brain

Browse - Programming Tips - Where is the time is going in my perl script?

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

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

A.  Here is a bash script that runs a nice profiler:


--- Put this in /usr/local/bin/myprof ---

#!/bin/sh if [[ -f tmon.out ]]; then rm tmon.out fi perl -d:DProf $* if [[ ! -f tmon.out ]]; then exit fi
Then run:
myprof myscript.pl
dprofpp
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

Add a comment

Sign in to add a comment
Copyright © 2008-2017, 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.