← 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/5.18.2/deprecate.pm
StatementsExecuted 61 statements in 516µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1521111µs111µsdeprecate::::CORE:substdeprecate::CORE:subst (opcode)
311104µs231µsdeprecate::::__loaded_from_coredeprecate::__loaded_from_core
31123µs261µsdeprecate::::importdeprecate::import
11111µs22µsdeprecate::::BEGIN@2deprecate::BEGIN@2
1118µs12µsdeprecate::::BEGIN@3deprecate::BEGIN@3
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package deprecate;
2222µs233µs
# spent 22µs (11+11) within deprecate::BEGIN@2 which was called: # once (11µs+11µs) by if::work at line 2
use strict;
# spent 22µs making 1 call to deprecate::BEGIN@2 # spent 11µs making 1 call to strict::import
32263µs216µs
# spent 12µs (8+4) within deprecate::BEGIN@3 which was called: # once (8µs+4µs) by if::work at line 3
use warnings;
# spent 12µs making 1 call to deprecate::BEGIN@3 # spent 4µs making 1 call to warnings::import
41300nsour $VERSION = 0.02;
5
6# our %Config can ignore %Config::Config, e.g. for testing
71100nsour %Config;
832µsunless (%Config) { require Config; *Config = \%Config::Config; }
9
10# This isn't a public API. It's internal to code maintained by the perl-porters
11# If you would like it to be a public API, please send a patch with
12# documentation and tests. Until then, it may change without warning.
13
# spent 231µs (104+127) within deprecate::__loaded_from_core which was called 3 times, avg 77µs/call: # 3 times (104µs+127µs) by deprecate::import at line 39, avg 77µs/call
sub __loaded_from_core {
1431µs my ($package, $file, $expect_leaf) = @_;
15
1637µs foreach my $pair ([qw(sitearchexp archlibexp)],
17 [qw(sitelibexp privlibexp)]) {
18637µs1223µs my ($site, $priv) = @Config{@$pair};
# spent 23µs making 12 calls to Config::FETCH, avg 2µs/call
1963µs if ($^O eq 'VMS') {
20 for my $d ($site, $priv) { $d = VMS::Filespec::unixify($d) };
21 }
22 # Just in case anyone managed to configure with trailing /s
236130µs12104µs s!/*$!!g foreach $site, $priv;
# spent 104µs making 12 calls to deprecate::CORE:subst, avg 9µs/call
24
256600ns next if $site eq $priv;
2669µs if (uc("$priv/$expect_leaf") eq uc($file)) {
27 return 1;
28 }
29 }
3037µs return 0;
31}
32
33
# spent 261µs (23+238) within deprecate::import which was called 3 times, avg 87µs/call: # 3 times (23µs+238µs) by Devel::InnerPackage::BEGIN@7 or Module::Pluggable::BEGIN@7 or Module::Pluggable::Object::BEGIN@11 at line 15 of if.pm, avg 87µs/call
sub import {
3434µs my ($package, $file) = caller;
35
3631µs my $expect_leaf = "$package.pm";
37314µs37µs $expect_leaf =~ s!::!/!g;
# spent 7µs making 3 calls to deprecate::CORE:subst, avg 2µs/call
38
39313µs3231µs if (__loaded_from_core($package, $file, $expect_leaf)) {
# spent 231µs making 3 calls to deprecate::__loaded_from_core, avg 77µs/call
40 my $call_depth=1;
41 my @caller;
42 while (@caller = caller $call_depth++) {
43 last if $caller[7] # use/require
44 and $caller[6] eq $expect_leaf; # the package file
45 }
46 unless (@caller) {
47 require Carp;
48 Carp::cluck(<<"EOM");
49Can't find use/require $expect_leaf in caller stack
50EOM
51 return;
52 }
53
54 # This is fragile, because it
55 # is directly poking in the internals of warnings.pm
56 my ($call_file, $call_line, $callers_bitmask) = @caller[1,2,9];
57
58 if (defined $callers_bitmask
59 && (vec($callers_bitmask, $warnings::Offsets{deprecated}, 1)
60 || vec($callers_bitmask, $warnings::Offsets{all}, 1))) {
61 warn <<"EOM";
62$package will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at $call_file, line $call_line.
63EOM
64 }
65 }
66}
67
6813µs1;
69
70__END__
 
# spent 111µs within deprecate::CORE:subst which was called 15 times, avg 7µs/call: # 12 times (104µs+0s) by deprecate::__loaded_from_core at line 23, avg 9µs/call # 3 times (7µs+0s) by deprecate::import at line 37, avg 2µs/call
sub deprecate::CORE:subst; # opcode