Profile of Test/Deep/MM.pm

← 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/MM.pm
Statements | Executed 111 statements in 786µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 85µs | 92µs | Test::Deep::MM::::import Test::Deep::MM::import
48 | 4 | 1 | 77µs | 77µs | Test::Deep::MM::::__ANON__[:25] Test::Deep::MM::__ANON__[:25]
4 | 2 | 1 | 40µs | 158µs | Test::Deep::MM::::new Test::Deep::MM::new
1 | 1 | 1 | 14µs | 28µs | Test::Deep::Stack::::BEGIN@1Test::Deep::Stack::BEGIN@1
4 | 1 | 1 | 11µs | 11µs | Test::Deep::MM::::__ANON__[:28] Test::Deep::MM::__ANON__[:28]
4 | 1 | 1 | 10µs | 10µs | Test::Deep::MM::::init Test::Deep::MM::init
1 | 1 | 1 | 10µs | 15µs | Test::Deep::Stack::::BEGIN@2Test::Deep::Stack::BEGIN@2
1 | 1 | 1 | 10µs | 23µs | Test::Deep::MM::::BEGIN@16 Test::Deep::MM::BEGIN@16
1 | 1 | 1 | 9µs | 21µs | Test::Deep::MM::::BEGIN@31 Test::Deep::MM::BEGIN@31
4 | 1 | 1 | 6µs | 6µs | Test::Deep::MM::::CORE:match Test::Deep::MM::CORE:match (opcode)

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

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 | 2 | 28µs | 2 | 43µs | # spent 28µs (14+15) within Test::Deep::Stack::BEGIN@1 which was called: # once (14µs+15µs) by Test::Deep::Stack::BEGIN@9 at line 1 use strict; # spent 28µs making 1 call to Test::Deep::Stack::BEGIN@1 # spent 15µs making 1 call to strict::import
2 | 2 | 88µs | 2 | 19µs | # spent 15µs (10+5) within Test::Deep::Stack::BEGIN@2 which was called: # once (10µs+5µs) by Test::Deep::Stack::BEGIN@9 at line 2 use warnings; # spent 15µs making 1 call to Test::Deep::Stack::BEGIN@2 # spent 5µs making 1 call to warnings::import
3 |  |  |  |  |
4 |  |  |  |  | package Test::Deep::MM;
5 |  |  |  |  |
6 |  |  |  |  | sub import
7 |  |  |  |  | # spent 92µs (85+7) within Test::Deep::MM::import which was called: # once (85µs+7µs) by Test::Deep::Stack::BEGIN@9 at line 9 of Test/Deep/Stack.pm {
8 | 1 | 800ns |  |  | my $self = shift;
9 |  |  |  |  |
10 | 1 | 2µs |  |  | my ($pkg) = caller();
11 | 1 | 1µs |  |  | my $mpkg = $pkg."::Methods";
12 | 1 | 6µs |  |  | foreach my $attr (@_)
13 |  |  |  |  | {
14 | 4 | 25µs | 4 | 6µs | if ($attr =~ /^[a-z]/) # spent 6µs making 4 calls to Test::Deep::MM::CORE:match, avg 2µs/call
15 |  |  |  |  | {
16 | 2 | 118µs | 2 | 37µs | # spent 23µs (10+14) within Test::Deep::MM::BEGIN@16 which was called: # once (10µs+14µs) by Test::Deep::Stack::BEGIN@9 at line 16 no strict 'refs'; # spent 23µs making 1 call to Test::Deep::MM::BEGIN@16 # spent 14µs making 1 call to strict::unimport
17 | 2 | 10µs |  |  | *{$mpkg."::$attr"} = \&{$attr};
18 |  |  |  |  | }
19 |  |  |  |  | else
20 |  |  |  |  | {
21 | 2 | 2µs |  |  | my $get_name = $mpkg."::get$attr";
22 | 2 | 1µs |  |  | my $set_name = $mpkg."::set$attr";
23 |  |  |  |  | # spent 77µs within Test::Deep::MM::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/MM.pm:25] which was called 48 times, avg 2µs/call: # 18 times (32µs+0s) by Test::Deep::Stack::push at line 24 of Test/Deep/Stack.pm, avg 2µs/call # 18 times (24µs+0s) by Test::Deep::Stack::pop at line 31 of Test/Deep/Stack.pm, avg 1µs/call # 8 times (13µs+0s) by Test::Deep::Stack::getLast at line 65 of Test/Deep/Stack.pm, avg 2µs/call # 4 times (9µs+0s) by Test::Deep::Stack::init at line 17 of Test/Deep/Stack.pm, avg 2µs/call my $get_sub = sub {
24 | 48 | 198µs |  |  | return $_[0]->{$attr};
25 | 2 | 4µs |  |  | };
26 |  |  |  |  | # spent 11µs within Test::Deep::MM::__ANON__[/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/site_perl/5.16.3/Test/Deep/MM.pm:28] which was called 4 times, avg 3µs/call: # 4 times (11µs+0s) by Test::Deep::Stack::init at line 17 of Test/Deep/Stack.pm, avg 3µs/call my $set_sub = sub {
27 | 4 | 17µs |  |  | return $_[0]->{$attr} = $_[1];
28 | 2 | 1µs |  |  | };
29 |  |  |  |  |
30 |  |  |  |  | {
31 | 4 | 183µs | 2 | 33µs | # spent 21µs (9+12) within Test::Deep::MM::BEGIN@31 which was called: # once (9µs+12µs) by Test::Deep::Stack::BEGIN@9 at line 31 no strict 'refs'; # spent 21µs making 1 call to Test::Deep::MM::BEGIN@31 # spent 12µs making 1 call to strict::unimport
32 | 2 | 16µs |  |  | *$get_name = $get_sub;
33 | 2 | 4µs |  |  | *$set_name = $set_sub;
34 | 2 | 19µs |  |  | push(@{$pkg."::ISA"}, $mpkg);
35 |  |  |  |  | }
36 |  |  |  |  | }
37 |  |  |  |  | }
38 |  |  |  |  | }
39 |  |  |  |  |
40 |  |  |  |  | sub new
41 |  |  |  |  | # spent 158µs (40+118) within Test::Deep::MM::new which was called 4 times, avg 40µs/call: # 2 times (25µs+69µs) by Test::Deep::cmp_details at line 163 of Test/Deep.pm, avg 47µs/call # 2 times (15µs+49µs) by Test::Deep::eq_deeply_cache at line 192 of Test/Deep.pm, avg 32µs/call {
42 | 4 | 2µs |  |  | my $pkg = shift;
43 |  |  |  |  |
44 | 4 | 16µs |  |  | my $self = bless {}, $pkg;
45 |  |  |  |  |
46 | 4 | 9µs | 4 | 118µs | $self->init(@_); # spent 118µs making 4 calls to Test::Deep::Stack::init, avg 30µs/call
47 |  |  |  |  |
48 | 4 | 13µs |  |  | return $self;
49 |  |  |  |  | }
50 |  |  |  |  |
51 |  |  |  |  | sub init
52 |  |  |  |  | # spent 10µs within Test::Deep::MM::init which was called 4 times, avg 3µs/call: # 4 times (10µs+0s) by Test::Deep::Stack::init at line 15 of Test/Deep/Stack.pm, avg 3µs/call {
53 | 4 | 1µs |  |  | my $self = shift;
54 |  |  |  |  |
55 | 4 | 18µs |  |  | while (@_)
56 |  |  |  |  | {
57 |  |  |  |  | my $name = shift || confess("No name");
58 |  |  |  |  |
59 |  |  |  |  | my $method = "set$name";
60 |  |  |  |  | $self->$method(shift);
61 |  |  |  |  | }
62 |  |  |  |  | }
63 |  |  |  |  |
64 | 1 | 2µs |  |  | 1;
|  |  |  |  | # spent 6µs within Test::Deep::MM::CORE:match which was called 4 times, avg 2µs/call: # 4 times (6µs+0s) by Test::Deep::MM::import at line 14, avg 2µs/call sub Test::Deep::MM::CORE:match; # opcode