← 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:01:12 2013

Filename/usr/share/perl/5.10/Tie/Hash.pm
StatementsExecuted 9 statements in 1.23ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11130µs131µsTie::Hash::::BEGIN@5 Tie::Hash::BEGIN@5
11117µs182µsTie::Hash::::BEGIN@6 Tie::Hash::BEGIN@6
11110µs10µsTie::StdHash::::TIEHASH Tie::StdHash::TIEHASH
0000s0sTie::ExtraHash::::CLEARTie::ExtraHash::CLEAR
0000s0sTie::ExtraHash::::DELETETie::ExtraHash::DELETE
0000s0sTie::ExtraHash::::EXISTSTie::ExtraHash::EXISTS
0000s0sTie::ExtraHash::::FETCHTie::ExtraHash::FETCH
0000s0sTie::ExtraHash::::FIRSTKEYTie::ExtraHash::FIRSTKEY
0000s0sTie::ExtraHash::::NEXTKEYTie::ExtraHash::NEXTKEY
0000s0sTie::ExtraHash::::SCALARTie::ExtraHash::SCALAR
0000s0sTie::ExtraHash::::STORETie::ExtraHash::STORE
0000s0sTie::ExtraHash::::TIEHASHTie::ExtraHash::TIEHASH
0000s0sTie::Hash::::CLEAR Tie::Hash::CLEAR
0000s0sTie::Hash::::EXISTS Tie::Hash::EXISTS
0000s0sTie::Hash::::TIEHASH Tie::Hash::TIEHASH
0000s0sTie::Hash::::new Tie::Hash::new
0000s0sTie::StdHash::::CLEAR Tie::StdHash::CLEAR
0000s0sTie::StdHash::::DELETE Tie::StdHash::DELETE
0000s0sTie::StdHash::::EXISTS Tie::StdHash::EXISTS
0000s0sTie::StdHash::::FETCH Tie::StdHash::FETCH
0000s0sTie::StdHash::::FIRSTKEY Tie::StdHash::FIRSTKEY
0000s0sTie::StdHash::::NEXTKEY Tie::StdHash::NEXTKEY
0000s0sTie::StdHash::::SCALAR Tie::StdHash::SCALAR
0000s0sTie::StdHash::::STORE Tie::StdHash::STORE
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Tie::Hash;
2
312µsour $VERSION = '1.03';
4
5355µs2232µs
# spent 131µs (30+101) within Tie::Hash::BEGIN@5 which was called: # once (30µs+101µs) by POSIX::SigRt::BEGIN@64 at line 5
use Carp;
# spent 131µs making 1 call to Tie::Hash::BEGIN@5 # spent 101µs making 1 call to Exporter::import
631.15ms2347µs
# spent 182µs (17+165) within Tie::Hash::BEGIN@6 which was called: # once (17µs+165µs) by POSIX::SigRt::BEGIN@64 at line 6
use warnings::register;
# spent 182µs making 1 call to Tie::Hash::BEGIN@6 # spent 165µs making 1 call to warnings::register::import
7
8sub new {
9 my $pkg = shift;
10 $pkg->TIEHASH(@_);
11}
12
13# Grandfather "new"
14
15sub TIEHASH {
16 my $pkg = shift;
17 if (defined &{"${pkg}::new"}) {
18 warnings::warnif("WARNING: calling ${pkg}->new since ${pkg}->TIEHASH is missing");
19 $pkg->new(@_);
20 }
21 else {
22 croak "$pkg doesn't define a TIEHASH method";
23 }
24}
25
26sub EXISTS {
27 my $pkg = ref $_[0];
28 croak "$pkg doesn't define an EXISTS method";
29}
30
31sub CLEAR {
32 my $self = shift;
33 my $key = $self->FIRSTKEY(@_);
34 my @keys;
35
36 while (defined $key) {
37 push @keys, $key;
38 $key = $self->NEXTKEY(@_, $key);
39 }
40 foreach $key (@keys) {
41 $self->DELETE(@_, $key);
42 }
43}
44
45# The Tie::StdHash package implements standard perl hash behaviour.
46# It exists to act as a base class for classes which only wish to
47# alter some parts of their behaviour.
48
49package Tie::StdHash;
50# @ISA = qw(Tie::Hash); # would inherit new() only
51
52113µs
# spent 10µs within Tie::StdHash::TIEHASH which was called: # once (10µs+0s) by C4::Context::BEGIN@106 at line 71 of POSIX.pm
sub TIEHASH { bless {}, $_[0] }
53sub STORE { $_[0]->{$_[1]} = $_[2] }
54sub FETCH { $_[0]->{$_[1]} }
55sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
56sub NEXTKEY { each %{$_[0]} }
57sub EXISTS { exists $_[0]->{$_[1]} }
58sub DELETE { delete $_[0]->{$_[1]} }
59sub CLEAR { %{$_[0]} = () }
60sub SCALAR { scalar %{$_[0]} }
61
62package Tie::ExtraHash;
63
64sub TIEHASH { my $p = shift; bless [{}, @_], $p }
65sub STORE { $_[0][0]{$_[1]} = $_[2] }
66sub FETCH { $_[0][0]{$_[1]} }
67sub FIRSTKEY { my $a = scalar keys %{$_[0][0]}; each %{$_[0][0]} }
68sub NEXTKEY { each %{$_[0][0]} }
69sub EXISTS { exists $_[0][0]->{$_[1]} }
70sub DELETE { delete $_[0][0]->{$_[1]} }
71sub CLEAR { %{$_[0][0]} = () }
72sub SCALAR { scalar %{$_[0][0]} }
73
7416µs1;