← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:38 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Class/Factory/Util.pm
StatementsExecuted 43 statements in 550µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
71156µs122µsClass::Factory::Util::::_scandirClass::Factory::Util::_scandir
11152µs184µsClass::Factory::Util::::_subclassesClass::Factory::Util::_subclasses
71120µs20µsClass::Factory::Util::::CORE:ftdirClass::Factory::Util::CORE:ftdir (opcode)
11117µs17µsClass::Factory::Util::::CORE:readdirClass::Factory::Util::CORE:readdir (opcode)
11116µs19µsClass::Factory::Util::::BEGIN@3Class::Factory::Util::BEGIN@3
51115µs15µsClass::Factory::Util::::CORE:ftfileClass::Factory::Util::CORE:ftfile (opcode)
11112µs12µsClass::Factory::Util::::CORE:open_dirClass::Factory::Util::CORE:open_dir (opcode)
1118µs8µsClass::Factory::Util::::importClass::Factory::Util::import
1117µs33µsClass::Factory::Util::::BEGIN@6Class::Factory::Util::BEGIN@6
1117µs19µsClass::Factory::Util::::BEGIN@17Class::Factory::Util::BEGIN@17
1116µs31µsClass::Factory::Util::::BEGIN@4Class::Factory::Util::BEGIN@4
1116µs6µsClass::Factory::Util::::CORE:substClass::Factory::Util::CORE:subst (opcode)
1114µs4µsClass::Factory::Util::::CORE:sortClass::Factory::Util::CORE:sort (opcode)
1112µs2µsClass::Factory::Util::::CORE:closedirClass::Factory::Util::CORE:closedir (opcode)
0000s0sClass::Factory::Util::::subclassesClass::Factory::Util::subclasses
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::Factory::Util;
2
3323µs223µs
# spent 19µs (16+4) within Class::Factory::Util::BEGIN@3 which was called: # once (16µs+4µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 3
use strict;
# spent 19µs making 1 call to Class::Factory::Util::BEGIN@3 # spent 4µs making 1 call to strict::import
4320µs256µs
# spent 31µs (6+25) within Class::Factory::Util::BEGIN@4 which was called: # once (6µs+25µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 4
use vars qw($VERSION);
# spent 31µs making 1 call to Class::Factory::Util::BEGIN@4 # spent 25µs making 1 call to vars::import
5
6334µs259µs
# spent 33µs (7+26) within Class::Factory::Util::BEGIN@6 which was called: # once (7µs+26µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 6
use Carp qw(confess);
# spent 33µs making 1 call to Class::Factory::Util::BEGIN@6 # spent 26µs making 1 call to Exporter::import
7
81600ns$VERSION = '1.7';
9
1013µs1;
11
12sub import
13
# spent 8µs within Class::Factory::Util::import which was called: # once (8µs+0s) by DateTime::Format::Builder::Parser::BEGIN@626 at line 626 of DateTime/Format/Builder/Parser.pm
{
14310µs my $caller = caller(0);
15
16 {
173273µs231µs
# spent 19µs (7+12) within Class::Factory::Util::BEGIN@17 which was called: # once (7µs+12µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 17
no strict 'refs';
# spent 19µs making 1 call to Class::Factory::Util::BEGIN@17 # spent 12µs making 1 call to strict::unimport
18 *{"${caller}::subclasses"} = \&_subclasses;
19 }
20}
21
22# deprecated
23sub subclasses { _subclasses(@_) }
24
25sub _subclasses
26
# spent 184µs (52+132) within Class::Factory::Util::_subclasses which was called: # once (52µs+132µs) by DateTime::Format::SQLite::BEGIN@16 at line 628 of DateTime/Format/Builder/Parser.pm
{
27856µs my $base = shift;
28
2916µs $base =~ s,::,/,g;
# spent 6µs making 1 call to Class::Factory::Util::CORE:subst
30
31 my %dirs = map { $_ => 1 } @INC;
32
33 my $dir = substr( $INC{"$base.pm"}, 0, (length $INC{"$base.pm"}) - 3 );
34
35 $dirs{$dir} = 1;
36
377122µs my @packages = map { _scandir( "$_/$base" ) } keys %dirs;
# spent 122µs making 7 calls to Class::Factory::Util::_scandir, avg 17µs/call
38
39 # Make list of unique elements
40 my %packages = map { $_ => 1 } @packages;
41
4214µs return sort keys %packages;
# spent 4µs making 1 call to Class::Factory::Util::CORE:sort
43}
44
45sub _scandir
46
# spent 122µs (56+66) within Class::Factory::Util::_scandir which was called 7 times, avg 17µs/call: # 7 times (56µs+66µs) by Class::Factory::Util::_subclasses at line 37, avg 17µs/call
{
4718129µs my $dir = shift;
48
49720µs return unless -d $dir;
# spent 20µs making 7 calls to Class::Factory::Util::CORE:ftdir, avg 3µs/call
50
51112µs opendir DIR, $dir
# spent 12µs making 1 call to Class::Factory::Util::CORE:open_dir
52 or confess ("Cannot open directory $dir: $!");
53
54 my @packages =
55 ( map { substr($_, 0, length($_) - 3) }
56632µs grep { substr($_, -3) eq '.pm' && -f "$dir/$_" }
# spent 17µs making 1 call to Class::Factory::Util::CORE:readdir # spent 15µs making 5 calls to Class::Factory::Util::CORE:ftfile, avg 3µs/call
57 readdir DIR
58 );
59
6012µs closedir DIR
# spent 2µs making 1 call to Class::Factory::Util::CORE:closedir
61 or confess("Cannot close directory $dir: $!" );
62
63 return @packages;
64}
65
66__END__
 
# spent 2µs within Class::Factory::Util::CORE:closedir which was called: # once (2µs+0s) by Class::Factory::Util::_scandir at line 60
sub Class::Factory::Util::CORE:closedir; # opcode
# spent 20µs within Class::Factory::Util::CORE:ftdir which was called 7 times, avg 3µs/call: # 7 times (20µs+0s) by Class::Factory::Util::_scandir at line 49, avg 3µs/call
sub Class::Factory::Util::CORE:ftdir; # opcode
# spent 15µs within Class::Factory::Util::CORE:ftfile which was called 5 times, avg 3µs/call: # 5 times (15µs+0s) by Class::Factory::Util::_scandir at line 56, avg 3µs/call
sub Class::Factory::Util::CORE:ftfile; # opcode
# spent 12µs within Class::Factory::Util::CORE:open_dir which was called: # once (12µs+0s) by Class::Factory::Util::_scandir at line 51
sub Class::Factory::Util::CORE:open_dir; # opcode
# spent 17µs within Class::Factory::Util::CORE:readdir which was called: # once (17µs+0s) by Class::Factory::Util::_scandir at line 56
sub Class::Factory::Util::CORE:readdir; # opcode
# spent 4µs within Class::Factory::Util::CORE:sort which was called: # once (4µs+0s) by Class::Factory::Util::_subclasses at line 42
sub Class::Factory::Util::CORE:sort; # opcode
# spent 6µs within Class::Factory::Util::CORE:subst which was called: # once (6µs+0s) by Class::Factory::Util::_subclasses at line 29
sub Class::Factory::Util::CORE:subst; # opcode