← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:22:39 2010

File /usr/local/lib/perl5/5.10.1/Test/Deep/Cache.pm
Statements Executed 229
Statement Execution Time 712µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111409µs2.28msTest::Deep::Cache::::BEGIN@6Test::Deep::Cache::BEGIN@6
1911206µs810µsTest::Deep::Cache::::cmpTest::Deep::Cache::cmp
1911117µs643µsTest::Deep::Cache::::addTest::Deep::Cache::add
11147µs92µsTest::Deep::Cache::::newTest::Deep::Cache::new
382140µs40µsTest::Deep::Cache::::typeTest::Deep::Cache::type
11125µs31µsTest::Deep::Cache::::localTest::Deep::Cache::local
0000s0sTest::Deep::Cache::::finishTest::Deep::Cache::finish
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1320µs217µsuse strict;
# spent 14µs making 1 call to Test::Deep::BEGIN@1 # spent 3µs making 1 call to strict::import
2324µs224µsuse warnings;
# spent 15µs making 1 call to Test::Deep::BEGIN@2 # spent 9µs making 1 call to warnings::import
3
4package Test::Deep::Cache;
5
63303µs12.28ms
# spent 2.28ms (409µs+1.87) within Test::Deep::Cache::BEGIN@6 which was called # once (409µs+1.87ms) by Test::Deep::BEGIN@7 at line 6
use Test::Deep::Cache::Simple;
# spent 2.28ms making 1 call to Test::Deep::Cache::BEGIN@6
7
8sub new
9
# spent 92µs (47+45) within Test::Deep::Cache::new which was called # once (47µs+45µs) by Test::Deep::cmp_details at line 144 of Test/Deep.pm
{
10641µs my $pkg = shift;
11
12 my $self = bless {}, $pkg;
13
14 $self->{expects} = [Test::Deep::Cache::Simple->new];
# spent 11µs making 1 call to Test::Deep::Cache::Simple::new
15 $self->{normal} = [Test::Deep::Cache::Simple->new];
# spent 3µs making 1 call to Test::Deep::Cache::Simple::new
16
17 $self->local;
# spent 31µs making 1 call to Test::Deep::Cache::local
18
19 return $self;
20}
21
22sub add
23
# spent 643µs (117+527) within Test::Deep::Cache::add which was called 19 times, avg 34µs/call: # 19 times (117µs+527µs) by Test::Deep::descend at line 297 of Test/Deep.pm, avg 34µs/call
{
245786µs my $self = shift;
25
26 my $type = $self->type;
# spent 17µs making 19 calls to Test::Deep::Cache::type, avg 921ns/call
27
28 $self->{$type}->[-1]->add(@_);
# spent 509µs making 19 calls to Test::Deep::Cache::Simple::add, avg 27µs/call
29}
30
31sub cmp
32
# spent 810µs (206+605) within Test::Deep::Cache::cmp which was called 19 times, avg 43µs/call: # 19 times (206µs+605µs) by Test::Deep::descend at line 287 of Test/Deep.pm, avg 43µs/call
{
33 # go through all the caches to see if we know this one
34
357685µs my $self = shift;
36
37 my $type = $self->type;
# spent 23µs making 19 calls to Test::Deep::Cache::type, avg 1µs/call
38
39 foreach my $cache (@{$self->{$type}})
40 {
413863µs38582µs return 1 if $cache->cmp(@_);
# spent 582µs making 38 calls to Test::Deep::Cache::Simple::cmp, avg 15µs/call
42 }
43
44 return 0
45}
46
47sub local
48
# spent 31µs (25+6) within Test::Deep::Cache::local which was called # once (25µs+6µs) by Test::Deep::Cache::new at line 17
{
4927µs my $self = shift;
50
51 foreach my $type (qw( expects normal ))
52 {
5327µs26µs push(@{$self->{$type}}, Test::Deep::Cache::Simple->new);
# spent 6µs making 2 calls to Test::Deep::Cache::Simple::new, avg 3µs/call
54 }
55}
56
57sub finish
58{
59 my $self = shift;
60
61 my $keep = shift;
62
63 foreach my $type (qw( expects normal ))
64 {
65 my $caches = $self->{$type};
66
67 my $last = pop @$caches;
68
69 $caches->[-1]->absorb($last) if $keep;
70 }
71}
72
73sub type
74
# spent 40µs within Test::Deep::Cache::type which was called 38 times, avg 1µs/call: # 19 times (23µs+0s) by Test::Deep::Cache::cmp at line 37, avg 1µs/call # 19 times (17µs+0s) by Test::Deep::Cache::add at line 26, avg 921ns/call
{
753875µs return $Test::Deep::Expects ? "expects" : "normal";
76}
77
7812µs1;