← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:13 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/Modern/Perl.pm
StatementsExecuted 31 statements in 3.65ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1112.10ms2.12msModern::Perl::::BEGIN@10Modern::Perl::BEGIN@10
111761µs761µsModern::Perl::::BEGIN@13Modern::Perl::BEGIN@13
111653µs8.99msModern::Perl::::BEGIN@16Modern::Perl::BEGIN@16
111325µs360µsModern::Perl::::BEGIN@9Modern::Perl::BEGIN@9
111228µs419µsModern::Perl::::BEGIN@12Modern::Perl::BEGIN@12
11123µs98µsModern::Perl::::importModern::Perl::import
11120µs20µsModern::Perl::::BEGIN@7Modern::Perl::BEGIN@7
1115µs5µsModern::Perl::::validate_dateModern::Perl::validate_date
1113µs3µ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{
32800ns $Modern::Perl::VERSION = '1.20121103';
4}
5# ABSTRACT: enable all of the features of Modern Perl with one import
6
7256µs120µs
# spent 20µs within Modern::Perl::BEGIN@7 which was called: # once (20µs+0s) by main::BEGIN@1 at line 7
use 5.010_000;
# spent 20µs making 1 call to Modern::Perl::BEGIN@7
8
92315µs2377µs
# spent 360µs (325+35) within Modern::Perl::BEGIN@9 which was called: # once (325µs+35µs) by main::BEGIN@1 at line 9
use strict;
# spent 360µs making 1 call to Modern::Perl::BEGIN@9 # spent 17µs making 1 call to strict::import
1022.00ms22.13ms
# spent 2.12ms (2.10+24µs) within Modern::Perl::BEGIN@10 which was called: # once (2.10ms+24µs) by main::BEGIN@1 at line 10
use warnings;
# spent 2.12ms making 1 call to Modern::Perl::BEGIN@10 # spent 10µs making 1 call to warnings::import
11
12281µs1419µs
# spent 419µs (228+192) within Modern::Perl::BEGIN@12 which was called: # once (228µs+192µs) by main::BEGIN@1 at line 12
use mro ();
# spent 419µs making 1 call to Modern::Perl::BEGIN@12
132756µs1761µs
# spent 761µs within Modern::Perl::BEGIN@13 which was called: # once (761µs+0s) by main::BEGIN@1 at line 13
use feature ();
# spent 761µs making 1 call to Modern::Perl::BEGIN@13
14
15# enable methods on filehandles; unnecessary when 5.14 autoloads them
162139µs18.99ms
# spent 8.99ms (653µs+8.33) within Modern::Perl::BEGIN@16 which was called: # once (653µs+8.33ms) by main::BEGIN@1 at line 16
use IO::File ();
# spent 8.99ms making 1 call to Modern::Perl::BEGIN@16
172265µs13µs
# spent 3µs within Modern::Perl::BEGIN@17 which was called: # once (3µs+0s) by main::BEGIN@1 at line 17
use IO::Handle ();
# spent 3µs making 1 call to Modern::Perl::BEGIN@17
18
1910sour $VERSION;
20
211100nsmy $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 2012;
31}
32
33sub import
34
# spent 98µs (23+75) within Modern::Perl::import which was called: # once (23µs+75µs) by main::BEGIN@1 at line 1 of examples/Atom-timer.pl
{
351500ns my ($class, $date) = @_;
361200ns $date = $wanted_date unless defined $date;
37
3811µs15µs my $feature_tag = validate_date( $date );
# spent 5µs making 1 call to Modern::Perl::validate_date
391200ns undef $wanted_date;
40
4111µs14µs warnings->import();
# spent 4µs making 1 call to warnings::import
4211µs110µs strict->import();
# spent 10µs making 1 call to strict::import
4312µs150µs feature->import( $feature_tag );
# spent 50µs making 1 call to feature::import
44113µs16µs mro::set_mro( scalar caller(), 'c3' );
# spent 6µs making 1 call to mro::set_mro
45}
46
47sub unimport
48{
49 warnings->unimport;
50 strict->unimport;
51 feature->unimport;
52}
53
5413µsmy %dates =
55(
56 2009 => ':5.10',
57 2010 => ':5.10',
58 2011 => ':5.12',
59 2012 => ':5.14',
60 2013 => ':5.16',
61);
62
63sub validate_date
64
# spent 5µs within Modern::Perl::validate_date which was called: # once (5µs+0s) by Modern::Perl::import at line 38
{
651200ns my $date = shift;
66
67 # always enable unicode_strings when available
681100ns unless ($date)
69 {
70110µs return ':5.12' if $] > 5.011003;
71 return ':5.10';
72 }
73
74 my $year = substr $date, 0, 4;
75 return $dates{$year} if exists $dates{$year};
76
77 die "Unknown date '$date' requested\n";
78}
79
80
8115µs1;
82
83__END__