← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:47 2015

Filename/usr/share/perl/5.20/Tie/Hash.pm
StatementsExecuted 7 statements in 682µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11115µs53µsTie::Hash::::BEGIN@5 Tie::Hash::BEGIN@5
1118µs90µsTie::Hash::::BEGIN@6 Tie::Hash::BEGIN@6
1113µs3µ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
31400nsour $VERSION = '1.05';
4
5230µs291µs
# spent 53µs (15+38) within Tie::Hash::BEGIN@5 which was called: # once (15µs+38µs) by C4::Context::BEGIN@105 at line 5
use Carp;
# spent 53µs making 1 call to Tie::Hash::BEGIN@5 # spent 38µs making 1 call to Exporter::import
62643µs2171µs
# spent 90µs (8+81) within Tie::Hash::BEGIN@6 which was called: # once (8µs+81µs) by C4::Context::BEGIN@105 at line 6
use warnings::register;
# spent 90µs making 1 call to Tie::Hash::BEGIN@6 # spent 81µ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 my $pkg_new = $pkg -> can ('new');
18
19 if ($pkg_new and $pkg ne __PACKAGE__) {
20 my $my_new = __PACKAGE__ -> can ('new');
21 if ($pkg_new == $my_new) {
22 #
23 # Prevent recursion
24 #
25 croak "$pkg must define either a TIEHASH() or a new() method";
26 }
27
28 warnings::warnif ("WARNING: calling ${pkg}->new since " .
29 "${pkg}->TIEHASH is missing");
30 $pkg -> new (@_);
31 }
32 else {
33 croak "$pkg doesn't define a TIEHASH method";
34 }
35}
36
37sub EXISTS {
38 my $pkg = ref $_[0];
39 croak "$pkg doesn't define an EXISTS method";
40}
41
42sub CLEAR {
43 my $self = shift;
44 my $key = $self->FIRSTKEY(@_);
45 my @keys;
46
47 while (defined $key) {
48 push @keys, $key;
49 $key = $self->NEXTKEY(@_, $key);
50 }
51 foreach $key (@keys) {
52 $self->DELETE(@_, $key);
53 }
54}
55
56# The Tie::StdHash package implements standard perl hash behaviour.
57# It exists to act as a base class for classes which only wish to
58# alter some parts of their behaviour.
59
60package Tie::StdHash;
61# @ISA = qw(Tie::Hash); # would inherit new() only
62
6316µs
# spent 3µs within Tie::StdHash::TIEHASH which was called: # once (3µs+0s) by C4::Context::BEGIN@105 at line 480 of POSIX.pm
sub TIEHASH { bless {}, $_[0] }
64sub STORE { $_[0]->{$_[1]} = $_[2] }
65sub FETCH { $_[0]->{$_[1]} }
66sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
67sub NEXTKEY { each %{$_[0]} }
68sub EXISTS { exists $_[0]->{$_[1]} }
69sub DELETE { delete $_[0]->{$_[1]} }
70sub CLEAR { %{$_[0]} = () }
71sub SCALAR { scalar %{$_[0]} }
72
73package Tie::ExtraHash;
74
75sub TIEHASH { my $p = shift; bless [{}, @_], $p }
76sub STORE { $_[0][0]{$_[1]} = $_[2] }
77sub FETCH { $_[0][0]{$_[1]} }
78sub FIRSTKEY { my $a = scalar keys %{$_[0][0]}; each %{$_[0][0]} }
79sub NEXTKEY { each %{$_[0][0]} }
80sub EXISTS { exists $_[0][0]->{$_[1]} }
81sub DELETE { delete $_[0][0]->{$_[1]} }
82sub CLEAR { %{$_[0][0]} = () }
83sub SCALAR { scalar %{$_[0][0]} }
84
8513µs1;