← 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/Test/PONAPI/Repository/MockDB/Table/Articles.pm
StatementsExecuted 20 statements in 550µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
19079032127ms127msTest::PONAPI::Repository::MockDB::Table::Articles::::COLUMNSTest::PONAPI::Repository::MockDB::Table::Articles::COLUMNS (xsub)
111241µs38.3msTest::PONAPI::Repository::MockDB::Table::Articles::::BEGIN@5Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@5
11122µs133µsTest::PONAPI::Repository::MockDB::Table::Articles::::BUILDARGSTest::PONAPI::Repository::MockDB::Table::Articles::BUILDARGS
11118µs7.78msTest::PONAPI::Repository::MockDB::Table::Articles::::BEGIN@4Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@4
11111µs111µsTest::PONAPI::Repository::MockDB::Table::Articles::::BEGIN@57Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@57
11110µs47µsTest::PONAPI::Repository::MockDB::Table::Articles::::BEGIN@9Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@9
1117µs89µsTest::PONAPI::Repository::MockDB::Table::Articles::::BEGIN@71Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@71
0000s0sTest::PONAPI::Repository::MockDB::Table::Articles::::__ANON__[lib/Test/PONAPI/Repository/MockDB/Table/Articles.pm:68]Test::PONAPI::Repository::MockDB::Table::Articles::__ANON__[lib/Test/PONAPI/Repository/MockDB/Table/Articles.pm:68]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# ABSTRACT: mock repository - table - Articles
2package Test::PONAPI::Repository::MockDB::Table::Articles;
3
4261µs215.5ms
# spent 7.78ms (18µs+7.76) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@4 which was called: # once (18µs+7.76ms) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 4
use Moose;
# spent 7.78ms making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@4 # spent 7.76ms making 1 call to Moose::import
52151µs138.3ms
# spent 38.3ms (241µs+38.1) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@5 which was called: # once (241µs+38.1ms) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 5
use Test::PONAPI::Repository::MockDB::Table::Relationships;
6
7114µs1670µsextends 'Test::PONAPI::Repository::MockDB::Table';
# spent 670µs making 1 call to Moose::extends
8
916µs137µs
# spent 47µs (10+37) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@9 which was called: # once (10µs+37µs) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 16
use constant COLUMNS => [qw[
# spent 37µs making 1 call to constant::import
10 id
11 title
12 body
13 created
14 updated
15 status
161120µs147µs]];
17
18
# spent 133µs (22+112) within Test::PONAPI::Repository::MockDB::Table::Articles::BUILDARGS which was called: # once (22µs+112µs) by Test::PONAPI::Repository::MockDB::Table::Articles::new at line 15 of (eval 45)[Eval/Closure.pm:144]
sub BUILDARGS {
191500ns my $class = shift;
2012µs my %args = @_ == 1 ? %{ $_[0] } : @_;
21
22 # We could abstract these to their own objects, but no need currently
2316µs186µs my $to_comments =
24 Test::PONAPI::Repository::MockDB::Table::Relationships->new(
25 TYPE => 'comments',
26 TABLE => 'rel_articles_comments',
27 ID_COLUMN => 'id_articles',
28 REL_ID_COLUMN => 'id_comments',
29 COLUMNS => [qw/ id_articles id_comments /],
30 ONE_TO_ONE => 0,
31 );
3213µs125µs my $to_authors =
33 Test::PONAPI::Repository::MockDB::Table::Relationships->new(
34 TYPE => 'people',
35 TABLE => 'rel_articles_people',
36 ID_COLUMN => 'id_articles',
37 REL_ID_COLUMN => 'id_people',
38 COLUMNS => [qw/ id_articles id_people /],
39 ONE_TO_ONE => 1,
40 );
41
4214µs %args = (
43 TYPE => 'articles',
44 TABLE => 'articles',
45 ID_COLUMN => 'id',
46 COLUMNS => COLUMNS(),
47 RELATIONS => {
48 authors => $to_authors,
49 comments => $to_comments,
50 },
51 %args,
52 );
53
5416µs return \%args;
55}
56
572108µs2211µs
# spent 111µs (11+100) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@57 which was called: # once (11µs+100µs) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 57
use PONAPI::Constants;
# spent 111µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@57 # spent 100µs making 1 call to Exporter::import
58override update_stmt => sub {
59 my ($self, %args) = @_;
60
61 my $values = $args{values} || {};
62 my $copy = { %$values };
63 $copy->{updated} = \'CURRENT_TIMESTAMP';
64
65 my ($stmt, $ret, $msg) = $self->SUPER::update_stmt(%args, values => $copy);
66 $ret ||= PONAPI_UPDATED_EXTENDED;
67 return $stmt, $ret, $msg;
6813µs1320µs};
# spent 320µs making 1 call to Moose::override
69
7015µs24.26ms__PACKAGE__->meta->make_immutable;
# spent 4.25ms making 1 call to Class::MOP::Class::make_immutable # spent 12µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::meta
71361µs2170µs
# spent 89µs (7+82) within Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@71 which was called: # once (7µs+82µs) by Test::PONAPI::Repository::MockDB::BEGIN@12 at line 71
no Moose; 1;
# spent 89µs making 1 call to Test::PONAPI::Repository::MockDB::Table::Articles::BEGIN@71 # spent 82µs making 1 call to Moose::unimport
72
73__END__
 
# spent 127ms within Test::PONAPI::Repository::MockDB::Table::Articles::COLUMNS which was called 190790 times, avg 664ns/call: # 92337 times (73.3ms+0s) by Test::PONAPI::Repository::MockDB::Table::_stmt_filters at line 162 of lib/Test/PONAPI/Repository/MockDB/Table.pm, avg 794ns/call # 76057 times (30.9ms+0s) by Test::PONAPI::Repository::MockDB::Table::_stmt_columns at line 144 of lib/Test/PONAPI/Repository/MockDB/Table.pm, avg 406ns/call # 22396 times (22.5ms+0s) by Test::PONAPI::Repository::MockDB::type_has_fields at line 76 of lib/Test/PONAPI/Repository/MockDB.pm, avg 1µs/call
sub Test::PONAPI::Repository::MockDB::Table::Articles::COLUMNS; # xsub