← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 11:58:52 2013
Reported on Tue Oct 15 12:02:15 2013

Filename/usr/share/perl5/Class/Factory/Util.pm
StatementsExecuted 88 statements in 1.23ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2211212µs453µsClass::Factory::Util::::_scandirClass::Factory::Util::_scandir
222187µs664µsClass::Factory::Util::::_subclassesClass::Factory::Util::_subclasses
2211117µs117µsClass::Factory::Util::::CORE:ftdirClass::Factory::Util::CORE:ftdir (opcode)
21145µs45µsClass::Factory::Util::::CORE:open_dirClass::Factory::Util::CORE:open_dir (opcode)
21138µs38µsClass::Factory::Util::::CORE:readdirClass::Factory::Util::CORE:readdir (opcode)
11127µs32µsClass::Factory::Util::::BEGIN@3Class::Factory::Util::BEGIN@3
81126µs26µsClass::Factory::Util::::CORE:ftfileClass::Factory::Util::CORE:ftfile (opcode)
22221µs21µsClass::Factory::Util::::importClass::Factory::Util::import
11119µs57µsClass::Factory::Util::::BEGIN@4Class::Factory::Util::BEGIN@4
21115µs15µsClass::Factory::Util::::CORE:closedirClass::Factory::Util::CORE:closedir (opcode)
11112µs53µsClass::Factory::Util::::BEGIN@6Class::Factory::Util::BEGIN@6
21112µs12µsClass::Factory::Util::::CORE:sortClass::Factory::Util::CORE:sort (opcode)
21112µs12µsClass::Factory::Util::::CORE:substClass::Factory::Util::CORE:subst (opcode)
11110µs24µsClass::Factory::Util::::BEGIN@17Class::Factory::Util::BEGIN@17
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
3354µs238µs
# spent 32µs (27+5) within Class::Factory::Util::BEGIN@3 which was called: # once (27µs+5µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 3
use strict;
# spent 32µs making 1 call to Class::Factory::Util::BEGIN@3 # spent 5µs making 1 call to strict::import
4354µs295µs
# spent 57µs (19+38) within Class::Factory::Util::BEGIN@4 which was called: # once (19µs+38µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 4
use vars qw($VERSION);
# spent 57µs making 1 call to Class::Factory::Util::BEGIN@4 # spent 38µs making 1 call to vars::import
5
6362µs293µs
# spent 53µs (12+40) within Class::Factory::Util::BEGIN@6 which was called: # once (12µs+40µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 6
use Carp qw(confess);
# spent 53µs making 1 call to Class::Factory::Util::BEGIN@6 # spent 40µs making 1 call to Exporter::import
7
811µs$VERSION = '1.7';
9
1013µs1;
11
12sub import
13
# spent 21µs within Class::Factory::Util::import which was called 2 times, avg 10µs/call: # once (11µs+0s) by DateTime::Format::Builder::Parser::BEGIN@626 at line 626 of DateTime/Format/Builder/Parser.pm # once (10µs+0s) by C4::ClassSortRoutine::BEGIN@24 at line 24 of /usr/share/koha/lib/C4/ClassSortRoutine.pm
{
1423µs my $caller = caller(0);
15
16 {
175374µs239µs
# spent 24µs (10+15) within Class::Factory::Util::BEGIN@17 which was called: # once (10µs+15µs) by DateTime::Format::Builder::Parser::BEGIN@626 at line 17
no strict 'refs';
# spent 24µs making 1 call to Class::Factory::Util::BEGIN@17 # spent 15µs making 1 call to strict::unimport
18213µs *{"${caller}::subclasses"} = \&_subclasses;
19 }
20}
21
22# deprecated
23sub subclasses { _subclasses(@_) }
24
25sub _subclasses
26
# spent 664µs (187+477) within Class::Factory::Util::_subclasses which was called 2 times, avg 332µs/call: # once (121µs+318µs) by DateTime::Format::MySQL::BEGIN@11 at line 628 of DateTime/Format/Builder/Parser.pm # once (66µs+159µs) by C4::ClassSortRoutine::GetSortRoutineNames at line 80 of /usr/share/koha/lib/C4/ClassSortRoutine.pm
{
2722µs my $base = shift;
28
29236µs212µs $base =~ s,::,/,g;
# spent 12µs making 2 calls to Class::Factory::Util::CORE:subst, avg 6µs/call
30
31230µs my %dirs = map { $_ => 1 } @INC;
32
33211µs my $dir = substr( $INC{"$base.pm"}, 0, (length $INC{"$base.pm"}) - 3 );
34
3523µs $dirs{$dir} = 1;
36
37271µs22453µs my @packages = map { _scandir( "$_/$base" ) } keys %dirs;
# spent 453µs making 22 calls to Class::Factory::Util::_scandir, avg 21µs/call
38
39 # Make list of unique elements
40211µs my %packages = map { $_ => 1 } @packages;
41
42236µs212µs return sort keys %packages;
# spent 12µs making 2 calls to Class::Factory::Util::CORE:sort, avg 6µs/call
43}
44
45sub _scandir
46
# spent 453µs (212+241) within Class::Factory::Util::_scandir which was called 22 times, avg 21µs/call: # 22 times (212µs+241µs) by Class::Factory::Util::_subclasses at line 37, avg 21µs/call
{
472220µs my $dir = shift;
48
4922237µs22117µs return unless -d $dir;
# spent 117µs making 22 calls to Class::Factory::Util::CORE:ftdir, avg 5µs/call
50
51264µs245µs opendir DIR, $dir
# spent 45µs making 2 calls to Class::Factory::Util::CORE:open_dir, avg 23µs/call
52 or confess ("Cannot open directory $dir: $!");
53
54 my @packages =
55 ( map { substr($_, 0, length($_) - 3) }
562113µs1064µs grep { substr($_, -3) eq '.pm' && -f "$dir/$_" }
# spent 38µs making 2 calls to Class::Factory::Util::CORE:readdir, avg 19µs/call # spent 26µs making 8 calls to Class::Factory::Util::CORE:ftfile, avg 3µs/call
57 readdir DIR
58 );
59
60225µs215µs closedir DIR
# spent 15µs making 2 calls to Class::Factory::Util::CORE:closedir, avg 7µs/call
61 or confess("Cannot close directory $dir: $!" );
62
6328µs return @packages;
64}
65
66__END__
 
# spent 15µs within Class::Factory::Util::CORE:closedir which was called 2 times, avg 7µs/call: # 2 times (15µs+0s) by Class::Factory::Util::_scandir at line 60, avg 7µs/call
sub Class::Factory::Util::CORE:closedir; # opcode
# spent 117µs within Class::Factory::Util::CORE:ftdir which was called 22 times, avg 5µs/call: # 22 times (117µs+0s) by Class::Factory::Util::_scandir at line 49, avg 5µs/call
sub Class::Factory::Util::CORE:ftdir; # opcode
# spent 26µs within Class::Factory::Util::CORE:ftfile which was called 8 times, avg 3µs/call: # 8 times (26µs+0s) by Class::Factory::Util::_scandir at line 56, avg 3µs/call
sub Class::Factory::Util::CORE:ftfile; # opcode
# spent 45µs within Class::Factory::Util::CORE:open_dir which was called 2 times, avg 23µs/call: # 2 times (45µs+0s) by Class::Factory::Util::_scandir at line 51, avg 23µs/call
sub Class::Factory::Util::CORE:open_dir; # opcode
# spent 38µs within Class::Factory::Util::CORE:readdir which was called 2 times, avg 19µs/call: # 2 times (38µs+0s) by Class::Factory::Util::_scandir at line 56, avg 19µs/call
sub Class::Factory::Util::CORE:readdir; # opcode
# spent 12µs within Class::Factory::Util::CORE:sort which was called 2 times, avg 6µs/call: # 2 times (12µs+0s) by Class::Factory::Util::_subclasses at line 42, avg 6µs/call
sub Class::Factory::Util::CORE:sort; # opcode
# spent 12µs within Class::Factory::Util::CORE:subst which was called 2 times, avg 6µs/call: # 2 times (12µs+0s) by Class::Factory::Util::_subclasses at line 29, avg 6µs/call
sub Class::Factory::Util::CORE:subst; # opcode