← 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:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/Devel/GlobalDestruction.pm
StatementsExecuted 12 statements in 312µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111819µs1.06msDevel::GlobalDestruction::::BEGIN@8Devel::GlobalDestruction::BEGIN@8
11110µs21µsDevel::GlobalDestruction::::BEGIN@3Devel::GlobalDestruction::BEGIN@3
1117µs18µsDevel::GlobalDestruction::::BEGIN@23Devel::GlobalDestruction::BEGIN@23
1116µs9µsDevel::GlobalDestruction::::BEGIN@4Devel::GlobalDestruction::BEGIN@4
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Devel::GlobalDestruction;
2
3220µs231µs
# spent 21µs (10+11) within Devel::GlobalDestruction::BEGIN@3 which was called: # once (10µs+11µs) by Class::MOP::Package::BEGIN@15 at line 3
use strict;
# spent 21µs making 1 call to Devel::GlobalDestruction::BEGIN@3 # spent 11µs making 1 call to strict::import
4248µs212µs
# spent 9µs (6+3) within Devel::GlobalDestruction::BEGIN@4 which was called: # once (6µs+3µs) by Class::MOP::Package::BEGIN@15 at line 4
use warnings;
# spent 9µs making 1 call to Devel::GlobalDestruction::BEGIN@4 # spent 3µs making 1 call to warnings::import
5
61500nsour $VERSION = '0.11';
7
8168µs
# spent 1.06ms (819µs+238µs) within Devel::GlobalDestruction::BEGIN@8 which was called: # once (819µs+238µs) by Class::MOP::Package::BEGIN@15 at line 11
use Sub::Exporter::Progressive -setup => {
9 exports => [ qw(in_global_destruction) ],
10 groups => { default => [ -all ] },
11154µs21.16ms};
# spent 1.06ms making 1 call to Devel::GlobalDestruction::BEGIN@8 # spent 99µs making 1 call to Sub::Exporter::Progressive::import
12
13# we run 5.14+ - everything is in core
14#
151700nsif (defined ${^GLOBAL_PHASE}) {
16127µs eval 'sub in_global_destruction () { ${^GLOBAL_PHASE} eq q[DESTRUCT] }; 1'
# spent 2µs executing statements in string eval
17 or die $@;
18}
19# try to load the xs version if it was compiled
20#
21elsif (eval {
22 require Devel::GlobalDestruction::XS;
23287µs228µs
# spent 18µs (7+11) within Devel::GlobalDestruction::BEGIN@23 which was called: # once (7µs+11µs) by Class::MOP::Package::BEGIN@15 at line 23
no warnings 'once';
# spent 18µs making 1 call to Devel::GlobalDestruction::BEGIN@23 # spent 11µs making 1 call to warnings::unimport
24 *in_global_destruction = \&Devel::GlobalDestruction::XS::in_global_destruction;
25 1;
26}) {
27 # the eval already installed everything, nothing to do
28}
29else {
30 # internally, PL_main_start is nulled immediately before entering global destruction
31 # and we can use B to detect that. It will also be null before the main runloop starts,
32 # so we check install a CHECK if needed to detect that.
33 require B;
34 my $started = !B::main_start()->isa(q[B::NULL]);
35 unless ($started) {
36 # work around 5.6 eval bug
37 eval '0 && $started; CHECK { $started = 1 }; 1'
38 or die $@;
39 }
40 eval '0 && $started; sub in_global_destruction () { $started && B::main_start()->isa(q[B::NULL]) }; 1'
41 or die $@;
42}
43
4417µs1; # keep require happy
45
46
47__END__