← Index
NYTProf Performance Profile   « line view »
For t/optimization.t
  Run on Thu Jan 8 22:47:42 2015
Reported on Thu Jan 8 22:48:05 2015

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/Cache.pm
StatementsExecuted 219 statements in 941µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111511µs1.86msTest::Deep::Cache::::BEGIN@6Test::Deep::Cache::BEGIN@6
1411226µs1.02msTest::Deep::Cache::::cmpTest::Deep::Cache::cmp
1411103µs545µsTest::Deep::Cache::::addTest::Deep::Cache::add
42261µs82µsTest::Deep::Cache::::localTest::Deep::Cache::local
21157µs79µsTest::Deep::Cache::::finishTest::Deep::Cache::finish
21146µs99µsTest::Deep::Cache::::newTest::Deep::Cache::new
282132µs32µsTest::Deep::Cache::::typeTest::Deep::Cache::type
11116µs34µsTest::Deep::::BEGIN@1 Test::Deep::BEGIN@1
11111µs18µsTest::Deep::::BEGIN@2 Test::Deep::BEGIN@2
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1227µs252µs
# spent 34µs (16+18) within Test::Deep::BEGIN@1 which was called: # once (16µs+18µs) by Test::Deep::BEGIN@7 at line 1
use strict;
# spent 34µs making 1 call to Test::Deep::BEGIN@1 # spent 18µs making 1 call to strict::import
2254µs226µs
# spent 18µs (11+7) within Test::Deep::BEGIN@2 which was called: # once (11µs+7µs) by Test::Deep::BEGIN@7 at line 2
use warnings;
# spent 18µs making 1 call to Test::Deep::BEGIN@2 # spent 7µs making 1 call to warnings::import
3
4package Test::Deep::Cache;
5
62379µs11.86ms
# spent 1.86ms (511µs+1.35) within Test::Deep::Cache::BEGIN@6 which was called: # once (511µs+1.35ms) by Test::Deep::BEGIN@7 at line 6
use Test::Deep::Cache::Simple;
# spent 1.86ms making 1 call to Test::Deep::Cache::BEGIN@6
7
8sub new
9
# spent 99µs (46+53) within Test::Deep::Cache::new which was called 2 times, avg 50µs/call: # 2 times (46µs+53µs) by Test::Deep::cmp_details at line 164 of Test/Deep.pm, avg 50µs/call
{
1022µs my $pkg = shift;
11
12210µs my $self = bless {}, $pkg;
13
14211µs214µs $self->{expects} = [Test::Deep::Cache::Simple->new];
# spent 14µs making 2 calls to Test::Deep::Cache::Simple::new, avg 7µs/call
1528µs25µs $self->{normal} = [Test::Deep::Cache::Simple->new];
# spent 5µs making 2 calls to Test::Deep::Cache::Simple::new, avg 2µs/call
16
1724µs234µs $self->local;
# spent 34µs making 2 calls to Test::Deep::Cache::local, avg 17µs/call
18
19210µs return $self;
20}
21
22sub add
23
# spent 545µs (103+442) within Test::Deep::Cache::add which was called 14 times, avg 39µs/call: # 14 times (103µs+442µs) by Test::Deep::descend at line 329 of Test/Deep.pm, avg 39µs/call
{
24144µs my $self = shift;
25
261419µs1413µs my $type = $self->type;
# spent 13µs making 14 calls to Test::Deep::Cache::type, avg 936ns/call
27
281455µs14429µs $self->{$type}->[-1]->add(@_);
# spent 429µs making 14 calls to Test::Deep::Cache::Simple::add, avg 31µs/call
29}
30
31sub cmp
32
# spent 1.02ms (226µs+796µs) within Test::Deep::Cache::cmp which was called 14 times, avg 73µs/call: # 14 times (226µs+796µs) by Test::Deep::descend at line 319 of Test/Deep.pm, avg 73µs/call
{
33 # go through all the caches to see if we know this one
34
35145µs my $self = shift;
36
371424µs1419µs my $type = $self->type;
# spent 19µs making 14 calls to Test::Deep::Cache::type, avg 1µs/call
38
391420µs foreach my $cache (@{$self->{$type}})
40 {
414097µs40778µs return 1 if $cache->cmp(@_);
# spent 778µs making 40 calls to Test::Deep::Cache::Simple::cmp, avg 19µs/call
42 }
43
441431µs return 0
45}
46
47sub local
48
# spent 82µs (61+22) within Test::Deep::Cache::local which was called 4 times, avg 21µs/call: # 2 times (34µs+14µs) by Test::Deep::eq_deeply_cache at line 193 of Test/Deep.pm, avg 24µs/call # 2 times (26µs+8µs) by Test::Deep::Cache::new at line 17, avg 17µs/call
{
4942µs my $self = shift;
50
51416µs foreach my $type (qw( expects normal ))
52 {
53837µs822µs push(@{$self->{$type}}, Test::Deep::Cache::Simple->new);
# spent 22µs making 8 calls to Test::Deep::Cache::Simple::new, avg 3µs/call
54 }
55}
56
57sub finish
58
# spent 79µs (57+22) within Test::Deep::Cache::finish which was called 2 times, avg 39µs/call: # 2 times (57µs+22µs) by Test::Deep::eq_deeply_cache at line 197 of Test/Deep.pm, avg 39µs/call
{
592900ns my $self = shift;
60
612700ns my $keep = shift;
62
6329µs foreach my $type (qw( expects normal ))
64 {
6543µs my $caches = $self->{$type};
66
67418µs my $last = pop @$caches;
68
69418µs422µs $caches->[-1]->absorb($last) if $keep;
# spent 22µs making 4 calls to Test::Deep::Cache::Simple::absorb, avg 5µs/call
70 }
71}
72
73sub type
74
# spent 32µs within Test::Deep::Cache::type which was called 28 times, avg 1µs/call: # 14 times (19µs+0s) by Test::Deep::Cache::cmp at line 37, avg 1µs/call # 14 times (13µs+0s) by Test::Deep::Cache::add at line 26, avg 936ns/call
{
752876µs return $Test::Deep::Expects ? "expects" : "normal";
76}
77
7812µs1;