Profile of Package/Stash.pm

← Index
NYTProf Performance Profile «block view•line view•sub view»
For xt/tapper-mcp-scheduler-with-db-longrun.t
Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:45 2012

Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Package/Stash.pm
Statements | Executed 41 statements in 855µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 222µs | 2.79ms | Package::Stash::::BEGIN@11Package::Stash::BEGIN@11
1 | 1 | 1 | 158µs | 158µs | Package::Stash::::BEGIN@40Package::Stash::BEGIN@40
1 | 1 | 1 | 13µs | 17µs | Package::Stash::::BEGIN@5Package::Stash::BEGIN@5
1 | 1 | 1 | 13µs | 169µs | Package::Stash::::BEGIN@48Package::Stash::BEGIN@48
1 | 1 | 1 | 9µs | 25µs | Package::Stash::::BEGIN@6Package::Stash::BEGIN@6
0 | 0 | 0 | 0s | 0s | Package::Stash::::add_package_symbolPackage::Stash::add_package_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::add_symbolPackage::Stash::add_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::bootstrapPackage::Stash::bootstrap
0 | 0 | 0 | 0s | 0s | Package::Stash::::get_all_symbolsPackage::Stash::get_all_symbols
0 | 0 | 0 | 0s | 0s | Package::Stash::::get_or_add_package_symbolPackage::Stash::get_or_add_package_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::get_or_add_symbolPackage::Stash::get_or_add_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::get_package_symbolPackage::Stash::get_package_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::get_symbolPackage::Stash::get_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::has_package_symbolPackage::Stash::has_package_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::has_symbolPackage::Stash::has_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::list_all_package_symbolsPackage::Stash::list_all_package_symbols
0 | 0 | 0 | 0s | 0s | Package::Stash::::list_all_symbolsPackage::Stash::list_all_symbols
0 | 0 | 0 | 0s | 0s | Package::Stash::::namePackage::Stash::name
0 | 0 | 0 | 0s | 0s | Package::Stash::::namespacePackage::Stash::namespace
0 | 0 | 0 | 0s | 0s | Package::Stash::::newPackage::Stash::new
0 | 0 | 0 | 0s | 0s | Package::Stash::::remove_globPackage::Stash::remove_glob
0 | 0 | 0 | 0s | 0s | Package::Stash::::remove_package_globPackage::Stash::remove_package_glob
0 | 0 | 0 | 0s | 0s | Package::Stash::::remove_package_symbolPackage::Stash::remove_package_symbol
0 | 0 | 0 | 0s | 0s | Package::Stash::::remove_symbolPackage::Stash::remove_symbol

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package Package::Stash;
2 |  |  |  |  | {
3 | 2 | 1µs |  |  | $Package::Stash::VERSION = '0.33';
4 |  |  |  |  | }
5 | 3 | 40µs | 2 | 20µs | # spent 17µs (13+4) within Package::Stash::BEGIN@5 which was called: # once (13µs+4µs) by Class::MOP::Package::BEGIN@16 at line 5 use strict; # spent 17µs making 1 call to Package::Stash::BEGIN@5 # spent 4µs making 1 call to strict::import
6 | 3 | 192µs | 2 | 40µs | # spent 25µs (9+16) within Package::Stash::BEGIN@6 which was called: # once (9µs+16µs) by Class::MOP::Package::BEGIN@16 at line 6 use warnings; # spent 25µs making 1 call to Package::Stash::BEGIN@6 # spent 15µs making 1 call to warnings::import
7 |  |  |  |  | # ABSTRACT: routines for manipulating stashes
8 |  |  |  |  |
9 | 1 | 100ns |  |  | our $IMPLEMENTATION;
10 |  |  |  |  |
11 |  |  |  |  | # spent 2.79ms (222µs+2.57) within Package::Stash::BEGIN@11 which was called: # once (222µs+2.57ms) by Class::MOP::Package::BEGIN@16 at line 46 BEGIN {
12 | 9 | 87µs |  |  | $IMPLEMENTATION = $ENV{PACKAGE_STASH_IMPLEMENTATION}
13 |  |  |  |  | if exists $ENV{PACKAGE_STASH_IMPLEMENTATION};
14 |  |  |  |  |
15 |  |  |  |  | my $err;
16 | 1 | 400ns |  |  | if ($IMPLEMENTATION) {
17 |  |  |  |  | if (!eval "require Package::Stash::$IMPLEMENTATION; 1") {
18 |  |  |  |  | require Carp;
19 |  |  |  |  | Carp::croak("Could not load Package::Stash::$IMPLEMENTATION: $@");
20 |  |  |  |  | }
21 |  |  |  |  | }
22 |  |  |  |  | else {
23 |  |  |  |  | for my $impl ('XS', 'PP') {
24 | 3 | 22µs |  |  | if (eval "require Package::Stash::$impl; 1;") { # spent 59µs executing statements in string eval
25 |  |  |  |  | $IMPLEMENTATION = $impl;
26 |  |  |  |  | last;
27 |  |  |  |  | }
28 |  |  |  |  | else {
29 |  |  |  |  | $err .= $@;
30 |  |  |  |  | }
31 |  |  |  |  | }
32 |  |  |  |  | }
33 |  |  |  |  |
34 |  |  |  |  | if (!$IMPLEMENTATION) {
35 |  |  |  |  | require Carp;
36 |  |  |  |  | Carp::croak("Could not find a suitable Package::Stash implementation: $err");
37 |  |  |  |  | }
38 |  |  |  |  |
39 |  |  |  |  | my $impl = "Package::Stash::$IMPLEMENTATION";
40 | 3 | 191µs | 3 | 4.09ms | # spent 158µs within Package::Stash::BEGIN@40 which was called: # once (158µs+0s) by Package::Stash::XS::new at line 46 my $from = $impl->new($impl); # spent 2.19ms making 1 call to Package::Stash::XS::new # spent 1.88ms making 1 call to utf8::AUTOLOAD # spent 25µs making 1 call to utf8::SWASHNEW
41 |  |  | 1 | 5µs | my $to = $impl->new(__PACKAGE__); # spent 5µs making 1 call to Package::Stash::XS::new
42 |  |  | 3 | 37µs | my $methods = $from->get_all_symbols('CODE'); # spent 25µs making 1 call to Package::Stash::XS::get_all_symbols # spent 10µs making 1 call to Package::Stash::XS::namespace # spent 900ns making 1 call to Package::Stash::XS::name
43 |  |  |  |  | for my $meth (keys %$methods) {
44 | 12 | 120µs | 24 | 97µs | $to->add_symbol("&$meth" => $methods->{$meth}); # spent 92µs making 12 calls to Package::Stash::XS::add_symbol, avg 8µs/call # spent 5µs making 12 calls to Package::Stash::XS::name, avg 408ns/call
45 |  |  |  |  | }
46 | 1 | 58µs | 2 | 2.95ms | } # spent 2.79ms making 1 call to Package::Stash::BEGIN@11 # spent 158µs making 1 call to Package::Stash::BEGIN@40
47 |  |  |  |  |
48 |  |  | 1 | 156µs | # spent 169µs (13+156) within Package::Stash::BEGIN@48 which was called: # once (13µs+156µs) by Class::MOP::Package::BEGIN@16 at line 56 use Package::DeprecationManager -deprecations => { # spent 156µs making 1 call to Package::DeprecationManager::import
49 |  |  |  |  | 'Package::Stash::add_package_symbol' => 0.14,
50 |  |  |  |  | 'Package::Stash::remove_package_glob' => 0.14,
51 |  |  |  |  | 'Package::Stash::has_package_symbol' => 0.14,
52 |  |  |  |  | 'Package::Stash::get_package_symbol' => 0.14,
53 |  |  |  |  | 'Package::Stash::get_or_add_package_symbol' => 0.14,
54 |  |  |  |  | 'Package::Stash::remove_package_symbol' => 0.14,
55 |  |  |  |  | 'Package::Stash::list_all_package_symbols' => 0.14,
56 | 3 | 141µs | 1 | 169µs | }; # spent 169µs making 1 call to Package::Stash::BEGIN@48
57 |  |  |  |  |
58 |  |  |  |  | sub add_package_symbol {
59 |  |  |  |  | #deprecated('add_package_symbol is deprecated, please use add_symbol');
60 |  |  |  |  | shift->add_symbol(@_);
61 |  |  |  |  | }
62 |  |  |  |  |
63 |  |  |  |  | sub remove_package_glob {
64 |  |  |  |  | #deprecated('remove_package_glob is deprecated, please use remove_glob');
65 |  |  |  |  | shift->remove_glob(@_);
66 |  |  |  |  | }
67 |  |  |  |  |
68 |  |  |  |  | sub has_package_symbol {
69 |  |  |  |  | #deprecated('has_package_symbol is deprecated, please use has_symbol');
70 |  |  |  |  | shift->has_symbol(@_);
71 |  |  |  |  | }
72 |  |  |  |  |
73 |  |  |  |  | sub get_package_symbol {
74 |  |  |  |  | #deprecated('get_package_symbol is deprecated, please use get_symbol');
75 |  |  |  |  | shift->get_symbol(@_);
76 |  |  |  |  | }
77 |  |  |  |  |
78 |  |  |  |  | sub get_or_add_package_symbol {
79 |  |  |  |  | #deprecated('get_or_add_package_symbol is deprecated, please use get_or_add_symbol');
80 |  |  |  |  | shift->get_or_add_symbol(@_);
81 |  |  |  |  | }
82 |  |  |  |  |
83 |  |  |  |  | sub remove_package_symbol {
84 |  |  |  |  | #deprecated('remove_package_symbol is deprecated, please use remove_symbol');
85 |  |  |  |  | shift->remove_symbol(@_);
86 |  |  |  |  | }
87 |  |  |  |  |
88 |  |  |  |  | sub list_all_package_symbols {
89 |  |  |  |  | #deprecated('list_all_package_symbols is deprecated, please use list_all_symbols');
90 |  |  |  |  | shift->list_all_symbols(@_);
91 |  |  |  |  | }
92 |  |  |  |  |
93 |  |  |  |  |
94 | 1 | 3µs |  |  | 1;
95 |  |  |  |  |
96 |  |  |  |  | __END__