Profile of lib/PONAPI/DAO.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/DAO.pm
Statements | Executed 1300043 statements in 7.62s

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
100001 | 2 | 1 | 11.0s | 681s | PONAPI::DAO::::_actionPONAPI::DAO::_action
50245 | 1 | 1 | 395ms | 448s | PONAPI::DAO::::retrieve_allPONAPI::DAO::retrieve_all
49756 | 1 | 1 | 369ms | 233s | PONAPI::DAO::::retrievePONAPI::DAO::retrieve
1 | 1 | 1 | 395µs | 64.6ms | PONAPI::DAO::::BEGIN@11PONAPI::DAO::BEGIN@11
1 | 1 | 1 | 384µs | 36.5ms | PONAPI::DAO::::BEGIN@15PONAPI::DAO::BEGIN@15
1 | 1 | 1 | 332µs | 20.9ms | PONAPI::DAO::::BEGIN@14PONAPI::DAO::BEGIN@14
1 | 1 | 1 | 318µs | 30.8ms | PONAPI::DAO::::BEGIN@10PONAPI::DAO::BEGIN@10
1 | 1 | 1 | 313µs | 33.8ms | PONAPI::DAO::::BEGIN@12PONAPI::DAO::BEGIN@12
1 | 1 | 1 | 303µs | 34.0ms | PONAPI::DAO::::BEGIN@13PONAPI::DAO::BEGIN@13
1 | 1 | 1 | 301µs | 53.0ms | PONAPI::DAO::::BEGIN@9PONAPI::DAO::BEGIN@9
1 | 1 | 1 | 288µs | 42.4ms | PONAPI::DAO::::BEGIN@8PONAPI::DAO::BEGIN@8
1 | 1 | 1 | 281µs | 39.6ms | PONAPI::DAO::::BEGIN@7PONAPI::DAO::BEGIN@7
1 | 1 | 1 | 242µs | 634ms | PONAPI::DAO::::BEGIN@6PONAPI::DAO::BEGIN@6
1 | 1 | 1 | 31µs | 48µs | PONAPI::DAO::::__ANON__[lib/PONAPI/DAO.pm:32]PONAPI::DAO::__ANON__[lib/PONAPI/DAO.pm:32]
1 | 1 | 1 | 16µs | 3.24ms | PONAPI::DAO::::BEGIN@4PONAPI::DAO::BEGIN@4
1 | 1 | 1 | 9µs | 84µs | PONAPI::DAO::::BEGIN@71PONAPI::DAO::BEGIN@71
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::createPONAPI::DAO::create
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::create_relationshipsPONAPI::DAO::create_relationships
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::deletePONAPI::DAO::delete
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::delete_relationshipsPONAPI::DAO::delete_relationships
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::retrieve_by_relationshipPONAPI::DAO::retrieve_by_relationship
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::retrieve_relationshipsPONAPI::DAO::retrieve_relationships
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::updatePONAPI::DAO::update
0 | 0 | 0 | 0s | 0s | PONAPI::DAO::::update_relationshipsPONAPI::DAO::update_relationships

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

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | # ABSTRACT: Data Abstraction Object class
2 |  |  |  |  | package PONAPI::DAO;
3 |  |  |  |  |
4 | 2 | 45µs | 2 | 6.45ms | # spent 3.24ms (16µs+3.22) within PONAPI::DAO::BEGIN@4 which was called: # once (16µs+3.22ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 4 use Moose; # spent 3.24ms making 1 call to PONAPI::DAO::BEGIN@4 # spent 3.22ms making 1 call to Moose::import
5 |  |  |  |  |
6 | 2 | 112µs | 1 | 634ms | # spent 634ms (242µs+634) within PONAPI::DAO::BEGIN@6 which was called: # once (242µs+634ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 6 use PONAPI::DAO::Request::Retrieve; # spent 634ms making 1 call to PONAPI::DAO::BEGIN@6
7 | 2 | 142µs | 1 | 39.6ms | # spent 39.6ms (281µs+39.4) within PONAPI::DAO::BEGIN@7 which was called: # once (281µs+39.4ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 7 use PONAPI::DAO::Request::RetrieveAll; # spent 39.6ms making 1 call to PONAPI::DAO::BEGIN@7
8 | 2 | 122µs | 1 | 42.4ms | # spent 42.4ms (288µs+42.1) within PONAPI::DAO::BEGIN@8 which was called: # once (288µs+42.1ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 8 use PONAPI::DAO::Request::RetrieveRelationships; # spent 42.4ms making 1 call to PONAPI::DAO::BEGIN@8
9 | 2 | 123µs | 1 | 53.0ms | # spent 53.0ms (301µs+52.7) within PONAPI::DAO::BEGIN@9 which was called: # once (301µs+52.7ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 9 use PONAPI::DAO::Request::RetrieveByRelationship; # spent 53.0ms making 1 call to PONAPI::DAO::BEGIN@9
10 | 2 | 128µs | 1 | 30.8ms | # spent 30.8ms (318µs+30.4) within PONAPI::DAO::BEGIN@10 which was called: # once (318µs+30.4ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 10 use PONAPI::DAO::Request::Create; # spent 30.8ms making 1 call to PONAPI::DAO::BEGIN@10
11 | 2 | 131µs | 1 | 64.6ms | # spent 64.6ms (395µs+64.2) within PONAPI::DAO::BEGIN@11 which was called: # once (395µs+64.2ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 11 use PONAPI::DAO::Request::CreateRelationships; # spent 64.6ms making 1 call to PONAPI::DAO::BEGIN@11
12 | 2 | 145µs | 1 | 33.8ms | # spent 33.8ms (313µs+33.5) within PONAPI::DAO::BEGIN@12 which was called: # once (313µs+33.5ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 12 use PONAPI::DAO::Request::Update; # spent 33.8ms making 1 call to PONAPI::DAO::BEGIN@12
13 | 2 | 128µs | 1 | 34.0ms | # spent 34.0ms (303µs+33.6) within PONAPI::DAO::BEGIN@13 which was called: # once (303µs+33.6ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 13 use PONAPI::DAO::Request::UpdateRelationships; # spent 34.0ms making 1 call to PONAPI::DAO::BEGIN@13
14 | 2 | 142µs | 1 | 20.9ms | # spent 20.9ms (332µs+20.5) within PONAPI::DAO::BEGIN@14 which was called: # once (332µs+20.5ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 14 use PONAPI::DAO::Request::Delete; # spent 20.9ms making 1 call to PONAPI::DAO::BEGIN@14
15 | 2 | 395µs | 1 | 36.5ms | # spent 36.5ms (384µs+36.1) within PONAPI::DAO::BEGIN@15 which was called: # once (384µs+36.1ms) by PONAPI::Server::ConfigReader::BEGIN@10 at line 15 use PONAPI::DAO::Request::DeleteRelationships; # spent 36.5ms making 1 call to PONAPI::DAO::BEGIN@15
16 |  |  |  |  |
17 | 1 | 2µs | 1 | 1.54ms | has repository => ( # spent 1.54ms making 1 call to Moose::has
18 |  |  |  |  | is => 'ro',
19 |  |  |  |  | does => 'PONAPI::Repository',
20 |  |  |  |  | required => 1,
21 |  |  |  |  | );
22 |  |  |  |  |
23 | 1 | 1µs | 1 | 1.31ms | has version => ( # spent 1.31ms making 1 call to Moose::has
24 |  |  |  |  | is => 'ro',
25 |  |  |  |  | isa => 'Str',
26 |  |  |  |  | required => 1,
27 |  |  |  |  | );
28 |  |  |  |  |
29 |  |  |  |  | has json => (
30 |  |  |  |  | is => 'ro',
31 |  |  |  |  | isa => 'JSON::XS',
32 | 1 | 49µs | 4 | 17µs | # spent 48µs (31+17) within PONAPI::DAO::__ANON__[lib/PONAPI/DAO.pm:32] which was called: # once (31µs+17µs) by PONAPI::DAO::new at line 45 of (eval 45)[Eval/Closure.pm:144] default => sub { JSON::XS->new->allow_nonref->utf8->canonical }, # spent 15µs making 1 call to JSON::XS::new # spent 1µs making 1 call to JSON::XS::allow_nonref # spent 700ns making 1 call to JSON::XS::canonical # spent 500ns making 1 call to JSON::XS::utf8
33 | 1 | 4µs | 1 | 1.33ms | ); # spent 1.33ms making 1 call to Moose::has
34 |  |  |  |  |
35 | 50245 | 407ms | 50245 | 448s | # spent 448s (395ms+448) within PONAPI::DAO::retrieve_all which was called 50245 times, avg 8.92ms/call: # 50245 times (395ms+448s) by PONAPI::Server::call at line 77 of lib/PONAPI/Server.pm, avg 8.92ms/call sub retrieve_all { shift->_action( 'PONAPI::DAO::Request::RetrieveAll' , @_ ) } # spent 448s making 50245 calls to PONAPI::DAO::_action, avg 8.91ms/call
36 | 49756 | 377ms | 49756 | 233s | # spent 233s (369ms+233) within PONAPI::DAO::retrieve which was called 49756 times, avg 4.68ms/call: # 49756 times (369ms+233s) by PONAPI::Server::call at line 77 of lib/PONAPI/Server.pm, avg 4.68ms/call sub retrieve { shift->_action( 'PONAPI::DAO::Request::Retrieve' , @_ ) } # spent 233s making 49756 calls to PONAPI::DAO::_action, avg 4.68ms/call
37 |  |  |  |  | sub retrieve_relationships { shift->_action( 'PONAPI::DAO::Request::RetrieveRelationships' , @_ ) }
38 |  |  |  |  | sub retrieve_by_relationship { shift->_action( 'PONAPI::DAO::Request::RetrieveByRelationship' , @_ ) }
39 |  |  |  |  | sub create { shift->_action( 'PONAPI::DAO::Request::Create' , @_ ) }
40 |  |  |  |  | sub create_relationships { shift->_action( 'PONAPI::DAO::Request::CreateRelationships' , @_ ) }
41 |  |  |  |  | sub update { shift->_action( 'PONAPI::DAO::Request::Update' , @_ ) }
42 |  |  |  |  | sub update_relationships { shift->_action( 'PONAPI::DAO::Request::UpdateRelationships' , @_ ) }
43 |  |  |  |  | sub delete : method { shift->_action( 'PONAPI::DAO::Request::Delete' , @_ ) }
44 |  |  |  |  | sub delete_relationships { shift->_action( 'PONAPI::DAO::Request::DeleteRelationships' , @_ ) }
45 |  |  |  |  |
46 |  |  |  |  | # spent 681s (11.0+670) within PONAPI::DAO::_action which was called 100001 times, avg 6.81ms/call: # 50245 times (6.60s+441s) by PONAPI::DAO::retrieve_all at line 35, avg 8.91ms/call # 49756 times (4.40s+228s) by PONAPI::DAO::retrieve at line 36, avg 4.68ms/call sub _action {
47 | 100001 | 51.4ms |  |  | my $self = shift;
48 | 100001 | 67.4ms |  |  | my $action_class = shift;
49 |  |  |  |  |
50 | 100001 | 111ms |  |  | my $ponapi_parameters = @_ == 1 ? $_[0] : +{ @_ };
51 | 100001 | 373ms | 100001 | 426ms | $ponapi_parameters->{repository} = $self->repository; # spent 426ms making 100001 calls to PONAPI::DAO::repository, avg 4µs/call
52 | 100001 | 401ms | 100001 | 368ms | $ponapi_parameters->{version} = $self->version; # spent 368ms making 100001 calls to PONAPI::DAO::version, avg 4µs/call
53 | 100001 | 360ms | 100001 | 322ms | $ponapi_parameters->{json} = $self->json; # spent 322ms making 100001 calls to PONAPI::DAO::json, avg 3µs/call
54 |  |  |  |  |
55 | 100001 | 48.2ms |  |  | local $@;
56 | 100001 | 37.0ms |  |  | my @ret;
57 |  |  |  |  | eval {
58 | 100001 | 1.65s | 200002 | 662s | @ret = $action_class->new($ponapi_parameters)->execute(); # spent 409s making 50245 calls to PONAPI::DAO::Request::RetrieveAll::execute, avg 8.14ms/call # spent 198s making 49756 calls to PONAPI::DAO::Request::Retrieve::execute, avg 3.97ms/call # spent 27.7s making 50245 calls to PONAPI::DAO::Request::RetrieveAll::new, avg 551µs/call # spent 27.5s making 49756 calls to PONAPI::DAO::Request::Retrieve::new, avg 552µs/call
59 | 100001 | 3.11s | 1330932 | 6.83s | 1; # spent 2.28s making 529024 calls to PONAPI::Builder::Links::DESTROY, avg 4µs/call # spent 1.27s making 270247 calls to PONAPI::Builder::Resource::DESTROY, avg 5µs/call # spent 845ms making 158776 calls to PONAPI::Builder::Relationship::DESTROY, avg 5µs/call # spent 834ms making 172883 calls to PONAPI::Builder::Resource::Identifier::DESTROY, avg 5µs/call # spent 694ms making 100001 calls to PONAPI::Builder::Document::DESTROY, avg 7µs/call # spent 476ms making 49756 calls to PONAPI::DAO::Request::Retrieve::DESTROY, avg 10µs/call # spent 435ms making 50245 calls to PONAPI::DAO::Request::RetrieveAll::DESTROY, avg 9µs/call
60 | 100001 | 115ms |  |  | } or do {
61 |  |  |  |  | my $e = $@ || 'Unknown error';
62 |  |  |  |  | @ret = PONAPI::Exception
63 |  |  |  |  | ->new_from_exception($e)
64 |  |  |  |  | ->as_response;
65 |  |  |  |  | };
66 |  |  |  |  |
67 | 100001 | 503ms |  |  | return @ret;
68 |  |  |  |  | }
69 |  |  |  |  |
70 | 1 | 3µs | 2 | 3.14ms | __PACKAGE__->meta->make_immutable; # spent 3.13ms making 1 call to Class::MOP::Class::make_immutable # spent 11µs making 1 call to PONAPI::DAO::meta
71 | 3 | 70µs | 2 | 159µs | # spent 84µs (9+75) within PONAPI::DAO::BEGIN@71 which was called: # once (9µs+75µs) by PONAPI::Server::ConfigReader::BEGIN@10 at line 71 no Moose; 1; # spent 84µs making 1 call to PONAPI::DAO::BEGIN@71 # spent 75µs making 1 call to Moose::unimport
72 |  |  |  |  |
73 |  |  |  |  | __END__