Profile of lib/PONAPI/Builder/Role/HasLinksBuilder.pm

← Index
NYTProf Performance Profile «line view»
For script/ponapi
Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:11 2016

Filename | /home/mickey/git_tree/PONAPI/Server/lib/PONAPI/Builder/Role/HasLinksBuilder.pm
Statements | Executed 529033 statements in 3.84s

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
529024 | 1 | 1 | 3.28s | 63.5s | PONAPI::Builder::Role::HasLinksBuilder::::_build_links_builderPONAPI::Builder::Role::HasLinksBuilder::_build_links_builder
1 | 1 | 1 | 392µs | 120ms | PONAPI::Builder::Role::HasLinksBuilder::::BEGIN@6PONAPI::Builder::Role::HasLinksBuilder::BEGIN@6
1 | 1 | 1 | 20µs | 2.38ms | PONAPI::Builder::Role::HasLinksBuilder::::BEGIN@4PONAPI::Builder::Role::HasLinksBuilder::BEGIN@4
1 | 1 | 1 | 11µs | 97µs | PONAPI::Builder::Role::HasLinksBuilder::::BEGIN@44PONAPI::Builder::Role::HasLinksBuilder::BEGIN@44
0 | 0 | 0 | 0s | 0s | PONAPI::Builder::Role::HasLinksBuilder::::add_linkPONAPI::Builder::Role::HasLinksBuilder::add_link
0 | 0 | 0 | 0s | 0s | PONAPI::Builder::Role::HasLinksBuilder::::add_linksPONAPI::Builder::Role::HasLinksBuilder::add_links

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

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | # ABSTRACT: document builder - role - links
2 |  |  |  |  | package PONAPI::Builder::Role::HasLinksBuilder;
3 |  |  |  |  |
4 | 2 | 57µs | 2 | 4.74ms | # spent 2.38ms (20µs+2.36) within PONAPI::Builder::Role::HasLinksBuilder::BEGIN@4 which was called: # once (20µs+2.36ms) by Module::Runtime::require_module at line 4 use Moose::Role; # spent 2.38ms making 1 call to PONAPI::Builder::Role::HasLinksBuilder::BEGIN@4 # spent 2.36ms making 1 call to Moose::Role::import
5 |  |  |  |  |
6 | 2 | 231µs | 1 | 120ms | # spent 120ms (392µs+120) within PONAPI::Builder::Role::HasLinksBuilder::BEGIN@6 which was called: # once (392µs+120ms) by Module::Runtime::require_module at line 6 use PONAPI::Builder::Links; # spent 120ms making 1 call to PONAPI::Builder::Role::HasLinksBuilder::BEGIN@6
7 |  |  |  |  |
8 | 1 | 2µs | 1 | 82µs | requires 'add_self_link'; # spent 82µs making 1 call to Moose::Role::requires
9 |  |  |  |  |
10 | 1 | 2µs | 1 | 121µs | has links_builder => ( # spent 121µs making 1 call to Moose::Role::has
11 |  |  |  |  | init_arg => undef,
12 |  |  |  |  | is => 'ro',
13 |  |  |  |  | isa => 'PONAPI::Builder::Links',
14 |  |  |  |  | lazy => 1,
15 |  |  |  |  | predicate => 'has_links_builder',
16 |  |  |  |  | builder => '_build_links_builder',
17 |  |  |  |  | handles => [qw[
18 |  |  |  |  | has_links
19 |  |  |  |  | has_link
20 |  |  |  |  | ]]
21 |  |  |  |  | );
22 |  |  |  |  |
23 | 529024 | 3.84s | 529024 | 60.2s | # spent 63.5s (3.28+60.2) within PONAPI::Builder::Role::HasLinksBuilder::_build_links_builder which was called 529024 times, avg 120µs/call: # 529024 times (3.28s+60.2s) by PONAPI::Builder::Document::links_builder or PONAPI::Builder::Relationship::links_builder or PONAPI::Builder::Resource::links_builder at line 12 of (eval 45)[Eval/Closure.pm:144], avg 120µs/call sub _build_links_builder { PONAPI::Builder::Links->new( parent => $_[0] ) } # spent 60.2s making 529024 calls to PONAPI::Builder::Links::new, avg 114µs/call
24 |  |  |  |  |
25 |  |  |  |  | # NOTE:
26 |  |  |  |  | # These need to be delegated so that they
27 |  |  |  |  | # can return the instance of the Builder
28 |  |  |  |  | # they are attached to and not the Links
29 |  |  |  |  | # Builder itself.
30 |  |  |  |  | # - SL
31 |  |  |  |  |
32 |  |  |  |  | sub add_link {
33 |  |  |  |  | my ($self, @args) = @_;
34 |  |  |  |  | $self->links_builder->add_link( @args );
35 |  |  |  |  | return $self;
36 |  |  |  |  | }
37 |  |  |  |  |
38 |  |  |  |  | sub add_links {
39 |  |  |  |  | my ($self, @args) = @_;
40 |  |  |  |  | $self->links_builder->add_links( @args );
41 |  |  |  |  | return $self;
42 |  |  |  |  | }
43 |  |  |  |  |
44 | 3 | 54µs | 2 | 183µs | # spent 97µs (11+86) within PONAPI::Builder::Role::HasLinksBuilder::BEGIN@44 which was called: # once (11µs+86µs) by Module::Runtime::require_module at line 44 no Moose::Role; 1; # spent 97µs making 1 call to PONAPI::Builder::Role::HasLinksBuilder::BEGIN@44 # spent 86µs making 1 call to Moose::Role::unimport
45 |  |  |  |  |
46 |  |  |  |  | __END__