← 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:46 2015

Filename/usr/share/perl5/Modern/Perl.pm
StatementsExecuted 64 statements in 13.0ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1114.74ms4.79msModern::Perl::::BEGIN@10Modern::Perl::BEGIN@10
1112.41ms2.41msModern::Perl::::BEGIN@13Modern::Perl::BEGIN@13
1112.37ms26.4msModern::Perl::::BEGIN@16Modern::Perl::BEGIN@16
1112.21ms2.29msModern::Perl::::BEGIN@9Modern::Perl::BEGIN@9
1111.57ms1.91msModern::Perl::::BEGIN@12Modern::Perl::BEGIN@12
444102µs473µsModern::Perl::::importModern::Perl::import
11142µs42µsModern::Perl::::BEGIN@7Modern::Perl::BEGIN@7
41116µs16µsModern::Perl::::validate_dateModern::Perl::validate_date
1115µs5µsModern::Perl::::BEGIN@17Modern::Perl::BEGIN@17
0000s0sModern::Perl::::VERSIONModern::Perl::VERSION
0000s0sModern::Perl::::unimportModern::Perl::unimport
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Modern::Perl;
2{
321µs $Modern::Perl::VERSION = '1.20140107';
4}
5# ABSTRACT: enable all of the features of Modern Perl with one import
6
7299µs142µs
# spent 42µs within Modern::Perl::BEGIN@7 which was called: # once (42µs+0s) by main::BEGIN@70 at line 7
use 5.010_000;
# spent 42µs making 1 call to Modern::Perl::BEGIN@7
8
922.21ms22.32ms
# spent 2.29ms (2.21+84µs) within Modern::Perl::BEGIN@9 which was called: # once (2.21ms+84µs) by main::BEGIN@70 at line 9
use strict;
# spent 2.29ms making 1 call to Modern::Perl::BEGIN@9 # spent 28µs making 1 call to strict::import
1024.63ms24.80ms
# spent 4.79ms (4.74+49µs) within Modern::Perl::BEGIN@10 which was called: # once (4.74ms+49µs) by main::BEGIN@70 at line 10
use warnings;
# spent 4.79ms making 1 call to Modern::Perl::BEGIN@10 # spent 12µs making 1 call to warnings::import
11
1221.44ms11.91ms
# spent 1.91ms (1.57+334µs) within Modern::Perl::BEGIN@12 which was called: # once (1.57ms+334µs) by main::BEGIN@70 at line 12
use mro ();
# spent 1.91ms making 1 call to Modern::Perl::BEGIN@12
1322.42ms12.41ms
# spent 2.41ms within Modern::Perl::BEGIN@13 which was called: # once (2.41ms+0s) by main::BEGIN@70 at line 13
use feature ();
# spent 2.41ms making 1 call to Modern::Perl::BEGIN@13
14
15# enable methods on filehandles; unnecessary when 5.14 autoloads them
1621.61ms126.4ms
# spent 26.4ms (2.37+24.0) within Modern::Perl::BEGIN@16 which was called: # once (2.37ms+24.0ms) by main::BEGIN@70 at line 16
use IO::File ();
# spent 26.4ms making 1 call to Modern::Perl::BEGIN@16
172386µs15µs
# spent 5µs within Modern::Perl::BEGIN@17 which was called: # once (5µs+0s) by main::BEGIN@70 at line 17
use IO::Handle ();
# spent 5µs making 1 call to Modern::Perl::BEGIN@17
18
191100nsour $VERSION;
20
211200nsmy $wanted_date;
22sub VERSION
23{
24 my ($self, $version) = @_;
25
26 return $VERSION unless defined $version;
27 return $VERSION if $version < 2009;
28
29 $wanted_date = $version if (caller(1))[3] =~ /::BEGIN/;
30 return 2014;
31}
32
33sub import
34
# spent 473µs (102+371) within Modern::Perl::import which was called 4 times, avg 118µs/call: # once (25µs+130µs) by Koha::AuthUtils::BEGIN@20 at line 20 of Koha/AuthUtils.pm # once (31µs+89µs) by main::BEGIN@70 at line 70 of svc/members/upsert # once (23µs+79µs) by Koha::Borrower::Debarments::BEGIN@20 at line 20 of Koha/Borrower/Debarments.pm # once (23µs+73µs) by C4::OAI::Sets::BEGIN@32 at line 32 of C4/OAI/Sets.pm
{
3543µs my ($class, $date) = @_;
3642µs $date = $wanted_date unless defined $date;
37
3848µs416µs my $feature_tag = validate_date( $date );
# spent 16µs making 4 calls to Modern::Perl::validate_date, avg 4µs/call
3942µs undef $wanted_date;
40
41411µs432µs warnings->import;
# spent 32µs making 4 calls to warnings::import, avg 8µs/call
4246µs441µs strict->import;
# spent 41µs making 4 calls to strict::import, avg 10µs/call
43414µs4211µs feature->import( $feature_tag );
# spent 211µs making 4 calls to feature::import, avg 53µs/call
44499µs471µs mro::set_mro( scalar caller(), 'c3' );
# spent 71µs making 4 calls to mro::set_mro, avg 18µs/call
45}
46
47sub unimport
48{
49 warnings->unimport;
50 strict->unimport;
51 feature->unimport;
52}
53
5415µsmy %dates =
55(
56 2009 => ':5.10',
57 2010 => ':5.10',
58 2011 => ':5.12',
59 2012 => ':5.14',
60 2013 => ':5.16',
61 2014 => ':5.18',
62);
63
64sub validate_date
65
# spent 16µs within Modern::Perl::validate_date which was called 4 times, avg 4µs/call: # 4 times (16µs+0s) by Modern::Perl::import at line 38, avg 4µs/call
{
6642µs my $date = shift;
67
68 # always enable unicode_strings when available
6942µs unless ($date)
70 {
71432µs return ':5.12' if $] > 5.011003;
72 return ':5.10';
73 }
74
75 my $year = substr $date, 0, 4;
76 return $dates{$year} if exists $dates{$year};
77
78 die "Unknown date '$date' requested\n";
79}
80
81
8215µs1;
83
84__END__