← Index
NYTProf Performance Profile   « line view »
For /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/bin/perlcritic
  Run on Sat Mar 19 22:12:22 2016
Reported on Sat Mar 19 22:14:11 2016

Filename/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/StringList.pm
StatementsExecuted 460 statements in 994µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3211588µs1.08msPerl::Critic::PolicyParameter::Behavior::StringList::::__ANON__[:60]Perl::Critic::PolicyParameter::Behavior::StringList::__ANON__[:60]
3211292µs383µsPerl::Critic::PolicyParameter::Behavior::StringList::::initialize_parameterPerl::Critic::PolicyParameter::Behavior::StringList::initialize_parameter
11115µs15µsPerl::Critic::PolicyParameter::Behavior::StringList::::BEGIN@10Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@10
1118µs61µsPerl::Critic::PolicyParameter::Behavior::StringList::::BEGIN@16Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@16
1117µs11µsPerl::Critic::PolicyParameter::Behavior::StringList::::BEGIN@12Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@12
1117µs286µsPerl::Critic::PolicyParameter::Behavior::StringList::::BEGIN@14Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@14
1116µs18µsPerl::Critic::PolicyParameter::Behavior::StringList::::BEGIN@11Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@11
0000s0sPerl::Critic::PolicyParameter::Behavior::StringList::::generate_parameter_descriptionPerl::Critic::PolicyParameter::Behavior::StringList::generate_parameter_description
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1##############################################################################
2# $URL$
3# $Date$
4# $Author$
5# $Revision$
6##############################################################################
7
8package Perl::Critic::PolicyParameter::Behavior::StringList;
9
10240µs115µs
# spent 15µs within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@10 which was called: # once (15µs+0s) by Perl::Critic::PolicyParameter::BEGIN@28 at line 10
use 5.006001;
11219µs229µs
# spent 18µs (6+11) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@11 which was called: # once (6µs+11µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 11
use strict;
# spent 18µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@11 # spent 11µs making 1 call to strict::import
12220µs214µs
# spent 11µs (7+4) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@12 which was called: # once (7µs+4µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 12
use warnings;
# spent 11µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@12 # spent 4µs making 1 call to warnings::import
13
14224µs2565µs
# spent 286µs (7+279) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@14 which was called: # once (7µs+279µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 14
use Perl::Critic::Utils qw{ :characters &words_from_string &hashify };
# spent 286µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@14 # spent 279µs making 1 call to Exporter::import
15
162226µs261µs
# spent 61µs (8+53) within Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@16 which was called: # once (8µs+53µs) by Perl::Critic::PolicyParameter::BEGIN@28 at line 16
use base qw{ Perl::Critic::PolicyParameter::Behavior };
# spent 61µs making 1 call to Perl::Critic::PolicyParameter::Behavior::StringList::BEGIN@16 # spent 53µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 53µs
17
181600nsour $VERSION = '1.121';
19
20#-----------------------------------------------------------------------------
21
22
# spent 383µs (292+90) within Perl::Critic::PolicyParameter::Behavior::StringList::initialize_parameter which was called 32 times, avg 12µs/call: # 32 times (292µs+90µs) by Perl::Critic::PolicyParameter::_initialize_from_behavior at line 115 of Perl/Critic/PolicyParameter.pm, avg 12µs/call
sub initialize_parameter {
23327µs my ($self, $parameter, $specification) = @_;
24
25 # Unfortunately, this has to be kept as a reference, rather than a regular
26 # array, due to a problem in Devel::Cycle
27 # (http://rt.cpan.org/Ticket/Display.html?id=25360) which causes
28 # t/92_memory_leaks.t to fall over.
29328µs my $always_present_values = $specification->{list_always_present_values};
303241µs3236µs $parameter->_get_behavior_values()->{always_present_values} =
# spent 36µs making 32 calls to Perl::Critic::PolicyParameter::_get_behavior_values, avg 1µs/call
31 $always_present_values;
32
333210µs if ( not $always_present_values ) {
34 $always_present_values = [];
35 }
36
37 $parameter->_set_parser(
38
# spent 1.08ms (588µs+491µs) within Perl::Critic::PolicyParameter::Behavior::StringList::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/PolicyParameter/Behavior/StringList.pm:60] which was called 32 times, avg 34µs/call: # 32 times (588µs+491µs) by Perl::Critic::PolicyParameter::parse_and_validate_config_value at line 231 of Perl/Critic/PolicyParameter.pm, avg 34µs/call
sub {
39 # Normally bad thing, obscuring a variable in a outer scope
40 # with a variable with the same name is being done here in
41 # order to remain consistent with the parser function interface.
42329µs my ($policy, $parameter, $config_string) = @_; ## no critic(Variables::ProhibitReusedNames)
43
443227µs my @values = @{$always_present_values};
453239µs3243µs my $value_string = $parameter->get_default_string();
# spent 43µs making 32 calls to Perl::Critic::PolicyParameter::get_default_string, avg 1µs/call
46
47325µs if (defined $config_string) {
48 $value_string = $config_string;
49 }
50
513246µs2762µs if ( defined $value_string ) {
# spent 62µs making 27 calls to Perl::Critic::Utils::words_from_string, avg 2µs/call
52 push @values, words_from_string($value_string);
53 }
54
5532139µs3287µs my %values = hashify(@values);
# spent 87µs making 32 calls to Perl::Critic::Utils::hashify, avg 3µs/call
56
573273µs32299µs $policy->__set_parameter_value($parameter, \%values);
# spent 299µs making 32 calls to Perl::Critic::Policy::__set_parameter_value, avg 9µs/call
58
593298µs return;
60 }
613294µs3254µs );
# spent 54µs making 32 calls to Perl::Critic::PolicyParameter::_set_parser, avg 2µs/call
62
633265µs return;
64}
65
66#-----------------------------------------------------------------------------
67
68sub generate_parameter_description {
69 my ($self, $parameter) = @_;
70
71 my $always_present_values =
72 $parameter->_get_behavior_values()->{always_present_values};
73
74 my $description = $parameter->_get_description_with_trailing_period();
75 if ( $description and $always_present_values ) {
76 $description .= qq{\n};
77 }
78
79 if ( $always_present_values ) {
80 $description .= 'Values that are always included: ';
81 $description .= join ', ', sort @{ $always_present_values };
82 $description .= $PERIOD;
83 }
84
85 return $description;
86}
87
8812µs1;
89
90__END__