← Index
NYTProf Performance Profile   « block view • line view • sub view »
For t/app_dpath.t
  Run on Tue Jun 5 15:25:28 2012
Reported on Tue Jun 5 15:26:09 2012

Filename/home/ss5/perl5/perlbrew/perls/perl-5.14.1/lib/site_perl/5.14.1/Test/Deep/Cache/Simple.pm
StatementsExecuted 3467 statements in 32.3ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3242110.2ms14.8msTest::Deep::Cache::Simple::::fn_get_keyTest::Deep::Cache::Simple::fn_get_key
108117.03ms12.6msTest::Deep::Cache::Simple::::addTest::Deep::Cache::Simple::add
216114.62ms14.8msTest::Deep::Cache::Simple::::cmpTest::Deep::Cache::Simple::cmp
324112.73ms2.73msTest::Deep::Cache::Simple::::CORE:sortTest::Deep::Cache::Simple::CORE:sort (opcode)
1112.36ms3.59msTest::Deep::Cache::Simple::::BEGIN@7Test::Deep::Cache::Simple::BEGIN@7
72311.39ms1.39msTest::Deep::Cache::Simple::::newTest::Deep::Cache::Simple::new
11157µs67µsTest::Deep::Cache::::BEGIN@1 Test::Deep::Cache::BEGIN@1
11139µs168µsTest::Deep::Cache::Simple::::BEGIN@10Test::Deep::Cache::Simple::BEGIN@10
11127µs45µsTest::Deep::Cache::::BEGIN@2 Test::Deep::Cache::BEGIN@2
11126µs140µsTest::Deep::Cache::Simple::::BEGIN@5Test::Deep::Cache::Simple::BEGIN@5
0000s0sTest::Deep::Cache::Simple::::__ANON__[:15]Test::Deep::Cache::Simple::__ANON__[:15]
0000s0sTest::Deep::Cache::Simple::::absorbTest::Deep::Cache::Simple::absorb
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1291µs277µs
# spent 67µs (57+10) within Test::Deep::Cache::BEGIN@1 which was called: # once (57µs+10µs) by Test::Deep::Cache::BEGIN@6 at line 1
use strict;
# spent 67µs making 1 call to Test::Deep::Cache::BEGIN@1 # spent 10µs making 1 call to strict::import
22125µs263µs
# spent 45µs (27+18) within Test::Deep::Cache::BEGIN@2 which was called: # once (27µs+18µs) by Test::Deep::Cache::BEGIN@6 at line 2
use warnings;
# spent 45µs making 1 call to Test::Deep::Cache::BEGIN@2 # spent 18µs making 1 call to warnings::import
3
4package Test::Deep::Cache::Simple;
52152µs2254µs
# spent 140µs (26+114) within Test::Deep::Cache::Simple::BEGIN@5 which was called: # once (26µs+114µs) by Test::Deep::Cache::BEGIN@6 at line 5
use Carp qw( confess );
# spent 140µs making 1 call to Test::Deep::Cache::Simple::BEGIN@5 # spent 114µs making 1 call to Exporter::import
6
72950µs23.85ms
# spent 3.59ms (2.36+1.22) within Test::Deep::Cache::Simple::BEGIN@7 which was called: # once (2.36ms+1.22ms) by Test::Deep::Cache::BEGIN@6 at line 7
use Scalar::Util qw( refaddr );
# spent 3.59ms making 1 call to Test::Deep::Cache::Simple::BEGIN@7 # spent 266µs making 1 call to Exporter::import
8
9BEGIN
10
# spent 168µs (39+128) within Test::Deep::Cache::Simple::BEGIN@10 which was called: # once (39µs+128µs) by Test::Deep::Cache::BEGIN@6 at line 21
{
11116µs if (grep /^weaken$/, @Scalar::Util::EXPORT_FAIL)
12 {
13 # we're running on a version of perl that has no weak refs, so we
14 # just install a no-op sub for weaken instead of importing it
15 *weaken = sub {};
16 }
17 else
18 {
1919µs1128µs Scalar::Util->import('weaken');
# spent 128µs making 1 call to Exporter::import
20 }
2111.06ms1168µs}
# spent 168µs making 1 call to Test::Deep::Cache::Simple::BEGIN@10
22
23sub new
24
# spent 1.39ms within Test::Deep::Cache::Simple::new which was called 72 times, avg 19µs/call: # 36 times (564µs+0s) by Test::Deep::Cache::local at line 53 of Test/Deep/Cache.pm, avg 16µs/call # 18 times (566µs+0s) by Test::Deep::Cache::new at line 14 of Test/Deep/Cache.pm, avg 31µs/call # 18 times (263µs+0s) by Test::Deep::Cache::new at line 15 of Test/Deep/Cache.pm, avg 15µs/call
{
2572121µs my $pkg = shift;
26
2772711µs my $self = bless {}, $pkg;
28
2972763µs return $self;
30}
31
32sub add
33
# spent 12.6ms (7.03+5.59) within Test::Deep::Cache::Simple::add which was called 108 times, avg 117µs/call: # 108 times (7.03ms+5.59ms) by Test::Deep::Cache::add at line 28 of Test/Deep/Cache.pm, avg 117µs/call
{
34108112µs my $self = shift;
35
36108242µs my ($d1, $d2) = @_;
37 {
382161.42ms local $SIG{__DIE__};
39
40 # cannot weaken read only refs, no harm if we can't as they never
41 # disappear
422161.90ms108505µs eval{weaken($d1)};
# spent 505µs making 108 calls to Scalar::Util::weaken, avg 5µs/call
432161.74ms108428µs eval{weaken($d2)};
# spent 428µs making 108 calls to Scalar::Util::weaken, avg 4µs/call
44 }
45
461082.65ms1084.65ms $self->{fn_get_key(@_)} = [$d1, $d2];
# spent 4.65ms making 108 calls to Test::Deep::Cache::Simple::fn_get_key, avg 43µs/call
47}
48
49sub cmp
50
# spent 14.8ms (4.62+10.2) within Test::Deep::Cache::Simple::cmp which was called 216 times, avg 69µs/call: # 216 times (4.62ms+10.2ms) by Test::Deep::Cache::cmp at line 41 of Test/Deep/Cache.pm, avg 69µs/call
{
51216242µs my $self = shift;
52
532161.27ms21610.2ms my $key = fn_get_key(@_);
# spent 10.2ms making 216 calls to Test::Deep::Cache::Simple::fn_get_key, avg 47µs/call
54216390µs my $pair = $self->{$key};
55
56 # are both weakened refs still valid, if not delete this entry
57216596µs if (ref($pair->[0]) and ref($pair->[1]))
58 {
59 return 1;
60 }
61 else
62 {
63216329µs delete $self->{$key};
642161.91ms return 0;
65 }
66}
67
68sub absorb
69{
70 my $self = shift;
71
72 my $other = shift;
73
74 @{$self}{keys %$other} = values %$other;
75}
76
77sub fn_get_key
78
# spent 14.8ms (10.2+4.63) within Test::Deep::Cache::Simple::fn_get_key which was called 324 times, avg 46µs/call: # 216 times (6.94ms+3.24ms) by Test::Deep::Cache::Simple::cmp at line 53, avg 47µs/call # 108 times (3.26ms+1.39ms) by Test::Deep::Cache::Simple::add at line 46, avg 43µs/call
{
7997215.5ms9724.63ms return join(",", sort (map {refaddr($_)} @_));
# spent 2.73ms making 324 calls to Test::Deep::Cache::Simple::CORE:sort, avg 8µs/call # spent 1.90ms making 648 calls to Scalar::Util::refaddr, avg 3µs/call
80}
81110µs1;
 
# spent 2.73ms within Test::Deep::Cache::Simple::CORE:sort which was called 324 times, avg 8µs/call: # 324 times (2.73ms+0s) by Test::Deep::Cache::Simple::fn_get_key at line 79, avg 8µs/call
sub Test::Deep::Cache::Simple::CORE:sort; # opcode