← 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 17:10:45 2013
Reported on Tue Oct 15 17:12:33 2013

Filename/usr/share/perl5/Date/Manip/Obj.pm
StatementsExecuted 278 statements in 3.17ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11122.3ms23.3msDate::Manip::Obj::::BEGIN@16Date::Manip::Obj::BEGIN@16
11117.9ms18.9msDate::Manip::Obj::::BEGIN@15Date::Manip::Obj::BEGIN@15
11116.3ms17.1msDate::Manip::Obj::::new_recurDate::Manip::Obj::new_recur
1115.08ms5.82msDate::Manip::Obj::::new_deltaDate::Manip::Obj::new_delta
972765µs17.7msDate::Manip::Obj::::newDate::Manip::Obj::new (recurses: max depth 1, inclusive time 17.0ms)
272163µs63µsDate::Manip::Obj::::CORE:matchDate::Manip::Obj::CORE:match (opcode)
272158µs58µsDate::Manip::Obj::::CORE:regcompDate::Manip::Obj::CORE:regcomp (opcode)
11130µs54µsDate::Manip::Obj::::BEGIN@10Date::Manip::Obj::BEGIN@10
11125µs190µsDate::Manip::Obj::::BEGIN@13Date::Manip::Obj::BEGIN@13
71122µs22µsDate::Manip::Obj::::_init_finalDate::Manip::Obj::_init_final
11122µs107µsDate::Manip::Obj::::BEGIN@18Date::Manip::Obj::BEGIN@18
11119µs1.44msDate::Manip::Obj::::configDate::Manip::Obj::config
11115µs20µsDate::Manip::Obj::::BEGIN@11Date::Manip::Obj::BEGIN@11
11114µs238µsDate::Manip::Obj::::BEGIN@12Date::Manip::Obj::BEGIN@12
11113µs72µsDate::Manip::Obj::::new_dateDate::Manip::Obj::new_date
11112µs70µsDate::Manip::Obj::::BEGIN@9Date::Manip::Obj::BEGIN@9
22110µs10µsDate::Manip::Obj::::CORE:qrDate::Manip::Obj::CORE:qr (opcode)
11110µs10µsDate::Manip::Obj::::tzDate::Manip::Obj::tz
1118µs8µsDate::Manip::Obj::::baseDate::Manip::Obj::base
0000s0sDate::Manip::Obj::::_init_argsDate::Manip::Obj::_init_args
0000s0sDate::Manip::Obj::::errDate::Manip::Obj::err
0000s0sDate::Manip::Obj::::is_dateDate::Manip::Obj::is_date
0000s0sDate::Manip::Obj::::is_deltaDate::Manip::Obj::is_delta
0000s0sDate::Manip::Obj::::is_recurDate::Manip::Obj::is_recur
0000s0sDate::Manip::Obj::::new_configDate::Manip::Obj::new_config
0000s0sDate::Manip::Obj::::versionDate::Manip::Obj::version
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
0170µsProfile data that couldn't be associated with a specific line:
# spent 70µs making 1 call to Date::Manip::Obj::BEGIN@9
117µspackage Date::Manip::Obj;
2# Copyright (c) 2008-2010 Sullivan Beck. All rights reserved.
3# This program is free software; you can redistribute it and/or modify it
4# under the same terms as Perl itself.
5
6########################################################################
7########################################################################
8
9466µs158µs
# spent 70µs (12+58) within Date::Manip::Obj::BEGIN@9 which was called: # once (12µs+58µs) by Date::Manip::Date::BEGIN@14 at line 0
require 5.010000;
# spent 58µs making 1 call to feature::import
10357µs279µs
# spent 54µs (30+24) within Date::Manip::Obj::BEGIN@10 which was called: # once (30µs+24µs) by Date::Manip::Date::BEGIN@14 at line 10
use warnings;
# spent 54µs making 1 call to Date::Manip::Obj::BEGIN@10 # spent 24µs making 1 call to warnings::import
11330µs224µs
# spent 20µs (15+5) within Date::Manip::Obj::BEGIN@11 which was called: # once (15µs+5µs) by Date::Manip::Date::BEGIN@14 at line 11
use strict;
# spent 20µs making 1 call to Date::Manip::Obj::BEGIN@11 # spent 5µs making 1 call to strict::import
12349µs2462µs
# spent 238µs (14+224) within Date::Manip::Obj::BEGIN@12 which was called: # once (14µs+224µs) by Date::Manip::Date::BEGIN@14 at line 12
use IO::File;
# spent 238µs making 1 call to Date::Manip::Obj::BEGIN@12 # spent 224µs making 1 call to Exporter::import
13376µs2356µs
# spent 190µs (25+166) within Date::Manip::Obj::BEGIN@13 which was called: # once (25µs+166µs) by Date::Manip::Date::BEGIN@14 at line 13
use Storable qw(dclone);
# spent 190µs making 1 call to Date::Manip::Obj::BEGIN@13 # spent 166µs making 1 call to Exporter::import
14
153151µs218.9ms
# spent 18.9ms (17.9+990µs) within Date::Manip::Obj::BEGIN@15 which was called: # once (17.9ms+990µs) by Date::Manip::Date::BEGIN@14 at line 15
use Date::Manip::Base;
# spent 18.9ms making 1 call to Date::Manip::Obj::BEGIN@15 # spent 4µs making 1 call to UNIVERSAL::import
163237µs223.4ms
# spent 23.3ms (22.3+1.05) within Date::Manip::Obj::BEGIN@16 which was called: # once (22.3ms+1.05ms) by Date::Manip::Date::BEGIN@14 at line 16
use Date::Manip::TZ;
# spent 23.3ms making 1 call to Date::Manip::Obj::BEGIN@16 # spent 9µs making 1 call to UNIVERSAL::import
17
1831.14ms2191µs
# spent 107µs (22+85) within Date::Manip::Obj::BEGIN@18 which was called: # once (22µs+85µs) by Date::Manip::Date::BEGIN@14 at line 18
use vars qw($VERSION);
# spent 107µs making 1 call to Date::Manip::Obj::BEGIN@18 # spent 85µs making 1 call to vars::import
191700ns$VERSION='6.11';
20
21########################################################################
22# METHODS
23########################################################################
24
25115µs19µsmy $dmo_rx = qr/^Date::Manip::(Base|TZ|Date|Delta|Recur)$/;
# spent 9µs making 1 call to Date::Manip::Obj::CORE:qr
2614µs11µsmy $dmh_rx = qr/^Date::Manip::(Date|Delta|Recur)$/;
# spent 1µs making 1 call to Date::Manip::Obj::CORE:qr
27
28
# spent 17.7ms (765µs+16.9) within Date::Manip::Obj::new which was called 9 times, avg 1.97ms/call: # 2 times (139µs+-139µs) by Date::Manip::Obj::new at line 104, avg 0s/call # 2 times (175µs+-175µs) by Date::Manip::Obj::new at line 103, avg 0s/call # once (134µs+10.2ms) by C4::Overdues::BEGIN@25 at line 66 of Date/Manip.pm # once (74µs+6.95ms) by C4::Overdues::BEGIN@25 at line 69 of Date/Manip.pm # once (115µs+46µs) by Date::Manip::Obj::new_delta at line 233 # once (92µs+62µs) by Date::Manip::Obj::new_recur at line 238 # once (37µs+22µs) by Date::Manip::Obj::new_date at line 228
sub new {
29922µs my(@args) = @_;
30914µs my(@allargs) = @args;
31
32 # Get the object or class.
33
34911µs my($self,$class);
35
369262µs3696µs if (ref($args[0]) =~ $dmo_rx) {
# spent 52µs making 18 calls to Date::Manip::Obj::CORE:match, avg 3µs/call # spent 45µs making 18 calls to Date::Manip::Obj::CORE:regcomp, avg 2µs/call
37 $self = shift(@args);
38 $class = ref($args[0]);
39
40 } elsif ($args[0] =~ $dmo_rx) {
41 $class = shift(@args);
42
43 } else {
44 warn "ERROR: [new] first argument must be a Date::Manip class/object\n";
45 return undef;
46 }
47
48 # Get an existing Date::Manip::* object, if any
49
5094µs my $obj;
51977µs1824µs if ($self) {
# spent 13µs making 9 calls to Date::Manip::Obj::CORE:regcomp, avg 1µs/call # spent 11µs making 9 calls to Date::Manip::Obj::CORE:match, avg 1µs/call
52 $obj = $self;
53 } elsif (ref($args[0]) =~ $dmo_rx) {
54 $obj = shift(@args);
55 }
56
57 # Find out if there are any config options (which will be the
58 # final argument).
59
6094µs my @config;
6196µs if (@args && ref($args[$#args]) eq 'ARRAY') {
62 @config = @{ pop(@args) };
63 }
64
65 # Any other arguments at this point are passed to _init.
66
67 # Get Base/TZ objects from an existing object
68
6996µs my($dmt,$dmb);
70
7198µs if ($obj) {
72521µs $dmb = $$obj{'objs'}{'base'} if (exists $$obj{'objs'}{'base'});
73512µs $dmt = $$obj{'objs'}{'tz'} if (exists $$obj{'objs'}{'tz'});
74 }
75
76 # Create a new empty object.
77
78957µs my $new = {
79 'objs' => {},
80 'data' => {},
81 'args' => [ @args ],
82 'err' => '',
83 };
84
85 # Create new Base/TZ objects if necessary
86
8796µs my $init = 1;
88926µs if (! $dmb) {
89
90 # We're creating first-time instances:
91 # $dmb = new Date::Manip::Base [,\@config];
92 # $dmt = new Date::Manip::TZ [,\@config];
93 # $obj = new Date::Manip::* [,\@config];
94
9549µs if ($class eq 'Date::Manip::Base') {
96 $dmb = $new;
97
98 } elsif ($class eq 'Date::Manip::TZ') {
99 $dmb = new Date::Manip::Base;
100 $dmt = $new;
101
102 } else {
103236µs20s $dmb = new Date::Manip::Base;
# spent 15.9ms making 2 calls to Date::Manip::Obj::new, avg 7.94ms/call, recursion: max depth 1, sum of overlapping time 15.9ms
104223µs20s $dmt = new Date::Manip::TZ $dmb;
# spent 1.14ms making 2 calls to Date::Manip::Obj::new, avg 572µs/call, recursion: max depth 1, sum of overlapping time 1.14ms
105 }
106
107 } elsif ($class eq 'Date::Manip::Base') {
108
109 # $dmb = new Date::Manip::Base $obj [,\@config];
110 # This should create a new instance of a Base object
111 # with the same configuration.
112
113 $new = dclone($dmb);
114 $$new{'cache'} = $$dmb{'cache'};
115 $dmb = $new;
116 $init = 0;
117
118 } elsif (@config && $class eq 'Date::Manip::TZ') {
119
120 # $dmt = new Date::Manip::TZ $obj,\@config;
121
122 $dmb = new Date::Manip::Base $obj,[@config];
123 $dmt = $new;
124
125 } elsif (@config) {
126
127 # $obj2 = new Date::Manip::* $obj1,\@config;
128
129 $dmb = new Date::Manip::Base $obj,\@config;
130 $dmt = new Date::Manip::TZ $dmb;
131
132 } elsif ($class eq 'Date::Manip::TZ') {
133
134 # $dmt = new Date::Manip::TZ $obj;
135 # Reuse $dmb object
136
137 $dmt = $new;
138
139 } else {
140
141 # $obj2 = new Date::Manip::* $boj1;
142 # Use existing $dmb/$dmt
143
144 }
145
146977µs bless $new,$class;
147
148924µs $$new{'objs'}{'base'} = $dmb;
14999µs $$new{'objs'}{'tz'} = $dmt if ($dmt);
150912µs $$dmb{'objs'}{'tz'} = $dmt if ($dmt);
151
152937µs916.0ms $new->_init() unless (! $init);
# spent 15.7ms making 2 calls to Date::Manip::Base::_init, avg 7.84ms/call # spent 157µs making 2 calls to Date::Manip::TZ::_init, avg 78µs/call # spent 54µs making 3 calls to Date::Manip::Date::_init, avg 18µs/call # spent 43µs making 1 call to Date::Manip::Recur::_init # spent 18µs making 1 call to Date::Manip::Delta::_init
153
154 # Apply configuration options and parse the string.
155
15696µs if (@config) {
157 $dmb->config(@config);
158 }
159
16093µs $new->_init_args() if (@args);
161947µs9847µs $new->_init_final();
# spent 824µs making 2 calls to Date::Manip::TZ::_init_final, avg 412µs/call # spent 22µs making 7 calls to Date::Manip::Obj::_init_final, avg 3µs/call
162
163946µs return $new;
164}
165
166sub _init_args {
167 my($self) = @_;
168
169 my @args = @{ $$self{'args'} };
170 if (@args) {
171 warn "WARNING: [new] invalid arguments: @args\n";
172 }
173}
174
175
# spent 22µs within Date::Manip::Obj::_init_final which was called 7 times, avg 3µs/call: # 7 times (22µs+0s) by Date::Manip::Obj::new at line 161, avg 3µs/call
sub _init_final {
17676µs my($self) = @_;
177721µs return;
178}
179
180sub new_config {
181 my(@args) = @_;
182
183 # Make sure that @opts is passed in as the final argument.
184
185 if (! @args ||
186 ! (ref($args[$#args]) eq 'ARRAY')) {
187 push(@args,['ignore','ignore']);
188 }
189
190 return new(@args);
191}
192
193
# spent 8µs within Date::Manip::Obj::base which was called: # once (8µs+0s) by C4::Overdues::BEGIN@25 at line 73 of Date/Manip.pm
sub base {
19412µs my($self) = @_;
195111µs return $$self{'objs'}{'base'};
196}
197
198
# spent 10µs within Date::Manip::Obj::tz which was called: # once (10µs+0s) by C4::Overdues::BEGIN@25 at line 74 of Date/Manip.pm
sub tz {
19912µs my($self) = @_;
200112µs return $$self{'objs'}{'tz'} if (exists $$self{'objs'}{'tz'});
201 return undef;
202}
203
204
# spent 1.44ms (19µs+1.42) within Date::Manip::Obj::config which was called: # once (19µs+1.42ms) by C4::Overdues::BEGIN@25 at line 67 of Date/Manip.pm
sub config {
20512µs my($self,@config) = @_;
20612µs my $dmb = $$self{'objs'}{'base'};
207
20817µs while (@config) {
20912µs my $var = shift(@config);
21011µs my $val = shift(@config);
21115µs11.42ms $dmb->_config_var($var,$val);
# spent 1.42ms making 1 call to Date::Manip::Base::_config_var
212 }
213}
214
215sub err {
216 my($self,$arg) = @_;
217 if ($arg) {
218 $$self{'err'} = '';
219 return;
220 } else {
221 return $$self{'err'};
222 }
223}
224
225
# spent 72µs (13+59) within Date::Manip::Obj::new_date which was called: # once (13µs+59µs) by C4::Overdues::BEGIN@25 at line 70 of Date/Manip.pm
sub new_date {
22611µs my(@args) = @_;
22713µs require Date::Manip::Date;
22819µs159µs return new Date::Manip::Date @args;
# spent 59µs making 1 call to Date::Manip::Obj::new
229}
230
# spent 5.82ms (5.08+735µs) within Date::Manip::Obj::new_delta which was called: # once (5.08ms+735µs) by C4::Overdues::BEGIN@25 at line 71 of Date/Manip.pm
sub new_delta {
23112µs my(@args) = @_;
2321152µs require Date::Manip::Delta;
233123µs1160µs return new Date::Manip::Delta @args;
# spent 160µs making 1 call to Date::Manip::Obj::new
234}
235
# spent 17.1ms (16.3+821µs) within Date::Manip::Obj::new_recur which was called: # once (16.3ms+821µs) by C4::Overdues::BEGIN@25 at line 72 of Date/Manip.pm
sub new_recur {
23612µs my(@args) = @_;
2371173µs require Date::Manip::Recur;
238118µs1154µs return new Date::Manip::Recur @args;
# spent 154µs making 1 call to Date::Manip::Obj::new
239}
240
241sub is_date {
242 return 0;
243}
244sub is_delta {
245 return 0;
246}
247sub is_recur {
248 return 0;
249}
250
251sub version {
252 my($self,$flag) = @_;
253 if ($flag && ref($self) ne "Date::Manip::Base") {
254 my $dmb = $$self{'objs'}{'base'};
255 my ($tz) = $dmb->_now("systz");
256 return "$VERSION [$tz]";
257 } else {
258 return $VERSION;
259 }
260}
261
262118µs1;
263# Local Variables:
264# mode: cperl
265# indent-tabs-mode: nil
266# cperl-indent-level: 3
267# cperl-continued-statement-offset: 2
268# cperl-continued-brace-offset: 0
269# cperl-brace-offset: 0
270# cperl-brace-imaginary-offset: 0
271# cperl-label-offset: -2
272# End:
 
# spent 63µs within Date::Manip::Obj::CORE:match which was called 27 times, avg 2µs/call: # 18 times (52µs+0s) by Date::Manip::Obj::new at line 36, avg 3µs/call # 9 times (11µs+0s) by Date::Manip::Obj::new at line 51, avg 1µs/call
sub Date::Manip::Obj::CORE:match; # opcode
# spent 10µs within Date::Manip::Obj::CORE:qr which was called 2 times, avg 5µs/call: # once (9µs+0s) by Date::Manip::Date::BEGIN@14 at line 25 # once (1µs+0s) by Date::Manip::Date::BEGIN@14 at line 26
sub Date::Manip::Obj::CORE:qr; # opcode
# spent 58µs within Date::Manip::Obj::CORE:regcomp which was called 27 times, avg 2µs/call: # 18 times (45µs+0s) by Date::Manip::Obj::new at line 36, avg 2µs/call # 9 times (13µs+0s) by Date::Manip::Obj::new at line 51, avg 1µs/call
sub Date::Manip::Obj::CORE:regcomp; # opcode