Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/Test/Fixture/DBIC/Schema.pm |
Statements | Executed 84 statements in 4.48ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 2.23ms | 2.71s | _insert | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 2.22ms | 2.41ms | BEGIN@8 | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 1.73ms | 2.18s | _delete_all | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 601µs | 2.02ms | BEGIN@7 | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 170µs | 4.89s | construct_fixture | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 20µs | 35µs | BEGIN@3 | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 19µs | 4.77ms | _validate_fixture | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 16µs | 20µs | BEGIN@2 | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 10µs | 64µs | BEGIN@9 | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 9µs | 604µs | _load_fixture | Test::Fixture::DBIC::Schema::
1 | 1 | 1 | 8µs | 80µs | BEGIN@5 | Test::Fixture::DBIC::Schema::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Test::Fixture::DBIC::Schema; | ||||
2 | 3 | 20µs | 2 | 25µs | # spent 20µs (16+4) within Test::Fixture::DBIC::Schema::BEGIN@2 which was called:
# once (16µs+4µs) by main::BEGIN@17 at line 2 # spent 20µs making 1 call to Test::Fixture::DBIC::Schema::BEGIN@2
# spent 4µs making 1 call to strict::import |
3 | 3 | 30µs | 2 | 51µs | # spent 35µs (20+15) within Test::Fixture::DBIC::Schema::BEGIN@3 which was called:
# once (20µs+15µs) by main::BEGIN@17 at line 3 # spent 35µs making 1 call to Test::Fixture::DBIC::Schema::BEGIN@3
# spent 16µs making 1 call to warnings::import |
4 | 1 | 600ns | our $VERSION = '0.03'; | ||
5 | 3 | 30µs | 2 | 154µs | # spent 80µs (8+73) within Test::Fixture::DBIC::Schema::BEGIN@5 which was called:
# once (8µs+73µs) by main::BEGIN@17 at line 5 # spent 80µs making 1 call to Test::Fixture::DBIC::Schema::BEGIN@5
# spent 73µs making 1 call to base::import |
6 | 1 | 900ns | our @EXPORT = qw/construct_fixture/; | ||
7 | 3 | 101µs | 2 | 2.25ms | # spent 2.02ms (601µs+1.41) within Test::Fixture::DBIC::Schema::BEGIN@7 which was called:
# once (601µs+1.41ms) by main::BEGIN@17 at line 7 # spent 2.02ms making 1 call to Test::Fixture::DBIC::Schema::BEGIN@7
# spent 231µs making 1 call to Exporter::import |
8 | 3 | 157µs | 1 | 2.41ms | # spent 2.41ms (2.22+184µs) within Test::Fixture::DBIC::Schema::BEGIN@8 which was called:
# once (2.22ms+184µs) by main::BEGIN@17 at line 8 # spent 2.41ms making 1 call to Test::Fixture::DBIC::Schema::BEGIN@8 |
9 | 3 | 263µs | 2 | 119µs | # spent 64µs (10+54) within Test::Fixture::DBIC::Schema::BEGIN@9 which was called:
# once (10µs+54µs) by main::BEGIN@17 at line 9 # spent 64µs making 1 call to Test::Fixture::DBIC::Schema::BEGIN@9
# spent 54µs making 1 call to Exporter::import |
10 | |||||
11 | # spent 4.89s (170µs+4.89) within Test::Fixture::DBIC::Schema::construct_fixture which was called:
# once (170µs+4.89s) by main::RUNTIME at line 37 of xt/tapper-mcp-scheduler-with-db-longrun.t | ||||
12 | 1 | 110µs | 2 | 103µs | validate( # spent 101µs making 1 call to Params::Validate::XS::validate
# spent 3µs making 1 call to UNIVERSAL::isa # spent 5µs executing statements in string eval |
13 | @_ => +{ | ||||
14 | schema => +{ isa => 'DBIx::Class::Schema' }, | ||||
15 | fixture => 1, | ||||
16 | } | ||||
17 | ); | ||||
18 | 1 | 4µs | my %args = @_; | ||
19 | |||||
20 | 1 | 5µs | 2 | 5.38ms | my $fixture = _validate_fixture(_load_fixture($args{fixture})); # spent 4.77ms making 1 call to Test::Fixture::DBIC::Schema::_validate_fixture
# spent 604µs making 1 call to Test::Fixture::DBIC::Schema::_load_fixture |
21 | 1 | 12µs | 1 | 2.18s | _delete_all($args{schema}); # spent 2.18s making 1 call to Test::Fixture::DBIC::Schema::_delete_all |
22 | 1 | 117µs | 1 | 2.71s | return _insert($args{schema}, $fixture); # spent 2.71s making 1 call to Test::Fixture::DBIC::Schema::_insert |
23 | } | ||||
24 | |||||
25 | # spent 604µs (9+594) within Test::Fixture::DBIC::Schema::_load_fixture which was called:
# once (9µs+594µs) by Test::Fixture::DBIC::Schema::construct_fixture at line 20 | ||||
26 | 1 | 1µs | my $stuff = shift; | ||
27 | |||||
28 | 1 | 900ns | if (ref $stuff) { | ||
29 | if (ref $stuff eq 'ARRAY') { | ||||
30 | return $stuff; | ||||
31 | } else { | ||||
32 | croak "invalid fixture stuff. should be ARRAY: $stuff"; | ||||
33 | } | ||||
34 | } else { | ||||
35 | 1 | 2µs | require YAML::Syck; | ||
36 | 1 | 6µs | 1 | 594µs | return YAML::Syck::LoadFile($stuff); # spent 594µs making 1 call to YAML::Syck::LoadFile |
37 | } | ||||
38 | } | ||||
39 | |||||
40 | # spent 4.77ms (19µs+4.76) within Test::Fixture::DBIC::Schema::_validate_fixture which was called:
# once (19µs+4.76ms) by Test::Fixture::DBIC::Schema::construct_fixture at line 20 | ||||
41 | 1 | 800ns | my $stuff = shift; | ||
42 | |||||
43 | 1 | 14µs | 1 | 4.76ms | Kwalify::validate( # spent 4.76ms making 1 call to Kwalify::validate |
44 | { | ||||
45 | type => 'seq', | ||||
46 | sequence => [ | ||||
47 | { | ||||
48 | type => 'map', | ||||
49 | mapping => { | ||||
50 | schema => { type => 'str', required => 1 }, | ||||
51 | name => { type => 'str', required => 1 }, | ||||
52 | data => { type => 'any', required => 1 }, | ||||
53 | }, | ||||
54 | } | ||||
55 | ] | ||||
56 | }, | ||||
57 | $stuff | ||||
58 | ); | ||||
59 | |||||
60 | 1 | 3µs | $stuff; | ||
61 | } | ||||
62 | |||||
63 | # spent 2.18s (1.73ms+2.18) within Test::Fixture::DBIC::Schema::_delete_all which was called:
# once (1.73ms+2.18s) by Test::Fixture::DBIC::Schema::construct_fixture at line 21 | ||||
64 | 1 | 700ns | my $schema = shift; | ||
65 | |||||
66 | 1 | 1.59ms | 77 | 2.18s | $schema->resultset($_)->delete for # spent 2.16s making 19 calls to DBIx::Class::ResultSet::delete, avg 114ms/call
# spent 15.5ms making 19 calls to DBIx::Class::Schema::resultset, avg 817µs/call
# spent 140µs making 19 calls to DBIx::Class::Schema::source_registrations, avg 7µs/call
# spent 34µs making 1 call to DBIx::Class::Schema::sources
# spent 15µs making 19 calls to UNIVERSAL::isa, avg 779ns/call |
67 | grep { $schema->source_registrations->{$_}->isa('DBIx::Class::ResultSource::Table') } | ||||
68 | 1 | 100ns | $schema->sources; | ||
69 | } | ||||
70 | |||||
71 | # spent 2.71s (2.23ms+2.71) within Test::Fixture::DBIC::Schema::_insert which was called:
# once (2.23ms+2.71s) by Test::Fixture::DBIC::Schema::construct_fixture at line 22 | ||||
72 | 1 | 2µs | my ($schema, $fixture) = @_; | ||
73 | |||||
74 | 1 | 2µs | my $result = {}; | ||
75 | 1 | 5µs | for my $row ( @{ $fixture } ) { | ||
76 | 22 | 849µs | 44 | 2.58s | $schema->resultset( $row->{schema} )->create( $row->{data} ); # spent 2.57s making 22 calls to DBIx::Class::ResultSet::create, avg 117ms/call
# spent 9.95ms making 22 calls to DBIx::Class::Schema::resultset, avg 452µs/call |
77 | 22 | 1.03ms | 44 | 127ms | $result->{ $row->{name} } = $schema->resultset( $row->{schema} )->find( $row->{data} ); # spent 115ms making 22 calls to DBIx::Class::ResultSet::find, avg 5.21ms/call
# spent 12.1ms making 22 calls to DBIx::Class::Schema::resultset, avg 552µs/call |
78 | } | ||||
79 | 1 | 119µs | return $result; | ||
80 | } | ||||
81 | |||||
82 | 1 | 4µs | 1; | ||
83 | __END__ |