Filename | /opt/perl-5.18.1/lib/site_perl/5.18.1/strictures.pm |
Statements | Executed 111 statements in 1.04ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
12 | 10 | 9 | 147µs | 522µs | import | strictures::
9 | 9 | 9 | 82µs | 161µs | VERSION | strictures::
3 | 1 | 1 | 25µs | 25µs | CORE:ftis (opcode) | strictures::
12 | 1 | 1 | 20µs | 20µs | CORE:match (opcode) | strictures::
1 | 1 | 1 | 15µs | 32µs | BEGIN@3 | strictures::
1 | 1 | 1 | 11µs | 23µs | BEGIN@20 | strictures::
1 | 1 | 1 | 10µs | 56µs | BEGIN@6 | strictures::
1 | 1 | 1 | 8µs | 29µs | BEGIN@4 | strictures::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strictures; | ||||
2 | |||||
3 | 2 | 35µs | 2 | 49µs | # spent 32µs (15+17) within strictures::BEGIN@3 which was called:
# once (15µs+17µs) by Moo::BEGIN@3 at line 3 # spent 32µs making 1 call to strictures::BEGIN@3
# spent 17µs making 1 call to strict::import |
4 | 2 | 49µs | 2 | 49µs | # spent 29µs (8+20) within strictures::BEGIN@4 which was called:
# once (8µs+20µs) by Moo::BEGIN@3 at line 4 # spent 29µs making 1 call to strictures::BEGIN@4
# spent 20µs making 1 call to warnings::import |
5 | |||||
6 | 2 | 106µs | 2 | 103µs | # spent 56µs (10+46) within strictures::BEGIN@6 which was called:
# once (10µs+46µs) by Moo::BEGIN@3 at line 6 # spent 56µs making 1 call to strictures::BEGIN@6
# spent 46µs making 1 call to constant::import |
7 | |||||
8 | 1 | 800ns | our $VERSION = '1.004004'; # 1.4.4 | ||
9 | |||||
10 | # spent 161µs (82+79) within strictures::VERSION which was called 9 times, avg 18µs/call:
# once (14µs+8µs) by Moo::BEGIN@3 at line 3 of Moo.pm
# once (8µs+13µs) by Sub::Defer::BEGIN@3 at line 3 of Sub/Defer.pm
# once (11µs+10µs) by Method::Generate::Constructor::BEGIN@3 at line 3 of Method/Generate/Constructor.pm
# once (9µs+8µs) by Moo::sification::BEGIN@3 at line 3 of Moo/sification.pm
# once (8µs+8µs) by Method::Generate::Accessor::BEGIN@3 at line 3 of Method/Generate/Accessor.pm
# once (8µs+8µs) by Sub::Quote::BEGIN@3 at line 3 of Sub/Quote.pm
# once (8µs+8µs) by Moo::HandleMoose::BEGIN@3 at line 3 of Moo/HandleMoose.pm
# once (8µs+8µs) by Moo::Object::BEGIN@3 at line 3 of Moo/Object.pm
# once (7µs+8µs) by Moo::_Utils::BEGIN@11 at line 11 of Moo/_Utils.pm | ||||
11 | 9 | 7µs | for ($_[1]) { | ||
12 | 9 | 12µs | last unless defined && !ref && int != 1; | ||
13 | die "Major version specified as $_ - this is strictures version 1"; | ||||
14 | } | ||||
15 | # disable this since Foo->VERSION(undef) correctly returns the version | ||||
16 | # and that can happen either if our caller passes undef explicitly or | ||||
17 | # because the for above autovivified $_[1] - I could make it stop but | ||||
18 | # it's pointless since we don't want to blow up if the caller does | ||||
19 | # something valid either. | ||||
20 | 2 | 454µs | 2 | 35µs | # spent 23µs (11+12) within strictures::BEGIN@20 which was called:
# once (11µs+12µs) by Moo::BEGIN@3 at line 20 # spent 23µs making 1 call to strictures::BEGIN@20
# spent 12µs making 1 call to warnings::unimport |
21 | 9 | 180µs | 9 | 79µs | shift->SUPER::VERSION(@_); # spent 79µs making 9 calls to UNIVERSAL::VERSION, avg 9µs/call |
22 | } | ||||
23 | |||||
24 | 1 | 100ns | my $extra_load_states; | ||
25 | |||||
26 | 1 | 39µs | 3 | 25µs | our $Smells_Like_VCS = (-e '.git' || -e '.svn' # spent 25µs making 3 calls to strictures::CORE:ftis, avg 8µs/call |
27 | || (-e '../../dist.ini' && (-e '../../.git' || -e '../../.svn'))); | ||||
28 | |||||
29 | # spent 522µs (147+375) within strictures::import which was called 12 times, avg 44µs/call:
# 3 times (33µs+100µs) by Moo::import at line 24 of Moo.pm, avg 44µs/call
# once (18µs+42µs) by Method::Generate::Constructor::BEGIN@3 at line 3 of Method/Generate/Constructor.pm
# once (18µs+29µs) by Moo::BEGIN@3 at line 3 of Moo.pm
# once (11µs+30µs) by Moo::sification::BEGIN@3 at line 3 of Moo/sification.pm
# once (12µs+30µs) by Moo::HandleMoose::BEGIN@3 at line 3 of Moo/HandleMoose.pm
# once (11µs+29µs) by Sub::Defer::BEGIN@3 at line 3 of Sub/Defer.pm
# once (11µs+29µs) by Method::Generate::Accessor::BEGIN@3 at line 3 of Method/Generate/Accessor.pm
# once (11µs+29µs) by Sub::Quote::BEGIN@3 at line 3 of Sub/Quote.pm
# once (11µs+28µs) by Moo::Object::BEGIN@3 at line 3 of Moo/Object.pm
# once (11µs+28µs) by Moo::_Utils::BEGIN@11 at line 11 of Moo/_Utils.pm | ||||
30 | 12 | 15µs | 12 | 170µs | strict->import; # spent 170µs making 12 calls to strict::import, avg 14µs/call |
31 | 12 | 19µs | 12 | 185µs | warnings->import(FATAL => 'all'); # spent 185µs making 12 calls to warnings::import, avg 15µs/call |
32 | |||||
33 | 12 | 9µs | my $extra_tests = do { | ||
34 | 12 | 9µs | if (exists $ENV{PERL_STRICTURES_EXTRA}) { | ||
35 | if (_PERL_LT_5_8_4 and $ENV{PERL_STRICTURES_EXTRA}) { | ||||
36 | die 'PERL_STRICTURES_EXTRA checks are not available on perls older than 5.8.4: ' | ||||
37 | . "please unset \$ENV{PERL_STRICTURES_EXTRA}\n"; | ||||
38 | } | ||||
39 | $ENV{PERL_STRICTURES_EXTRA}; | ||||
40 | } elsif (! _PERL_LT_5_8_4) { | ||||
41 | 12 | 63µs | 12 | 20µs | !!((caller)[1] =~ /^(?:t|xt|lib|blib)/ # spent 20µs making 12 calls to strictures::CORE:match, avg 2µs/call |
42 | and $Smells_Like_VCS) | ||||
43 | } | ||||
44 | }; | ||||
45 | 12 | 40µs | if ($extra_tests) { | ||
46 | $extra_load_states ||= do { | ||||
47 | |||||
48 | my (%rv, @failed); | ||||
49 | foreach my $mod (qw(indirect multidimensional bareword::filehandles)) { | ||||
50 | eval "require $mod; \$rv{'$mod'} = 1;" or do { | ||||
51 | push @failed, $mod; | ||||
52 | |||||
53 | # courtesy of the 5.8 require bug | ||||
54 | # (we do a copy because 5.16.2 at least uses the same read-only | ||||
55 | # scalars for the qw() list and it doesn't seem worth a $^V check) | ||||
56 | |||||
57 | (my $file = $mod) =~ s|::|/|g; | ||||
58 | delete $INC{"${file}.pm"}; | ||||
59 | }; | ||||
60 | } | ||||
61 | |||||
62 | if (@failed) { | ||||
63 | my $failed = join ' ', @failed; | ||||
64 | print STDERR <<EOE; | ||||
65 | strictures.pm extra testing active but couldn't load all modules. Missing were: | ||||
66 | |||||
67 | $failed | ||||
68 | |||||
69 | Extra testing is auto-enabled in checkouts only, so if you're the author | ||||
70 | of a strictures-using module you need to run: | ||||
71 | |||||
72 | cpan indirect multidimensional bareword::filehandles | ||||
73 | |||||
74 | but these modules are not required by your users. | ||||
75 | EOE | ||||
76 | } | ||||
77 | |||||
78 | \%rv; | ||||
79 | }; | ||||
80 | |||||
81 | indirect->unimport(':fatal') if $extra_load_states->{indirect}; | ||||
82 | multidimensional->unimport if $extra_load_states->{multidimensional}; | ||||
83 | bareword::filehandles->unimport if $extra_load_states->{'bareword::filehandles'}; | ||||
84 | } | ||||
85 | } | ||||
86 | |||||
87 | 1 | 7µs | 1; | ||
88 | |||||
89 | __END__ | ||||
# spent 25µs within strictures::CORE:ftis which was called 3 times, avg 8µs/call:
# 3 times (25µs+0s) by Moo::BEGIN@3 at line 26, avg 8µs/call | |||||
# spent 20µs within strictures::CORE:match which was called 12 times, avg 2µs/call:
# 12 times (20µs+0s) by strictures::import at line 41, avg 2µs/call |