| Filename | /2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/DBIx/Class/Componentised.pm |
| Statements | Executed 873 statements in 2.98ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 42 | 1 | 1 | 2.21ms | 10.0ms | DBIx::Class::Componentised::inject_base |
| 1 | 1 | 1 | 618µs | 784µs | DBIx::Class::Componentised::BEGIN@10 |
| 1 | 1 | 1 | 16µs | 21µs | DBIx::Class::Componentised::BEGIN@4 |
| 1 | 1 | 1 | 8µs | 1.02ms | DBIx::Class::Componentised::BEGIN@7 |
| 1 | 1 | 1 | 8µs | 24µs | DBIx::Class::Componentised::BEGIN@5 |
| 1 | 1 | 1 | 7µs | 16µs | DBIx::Class::Componentised::BEGIN@29 |
| 1 | 1 | 1 | 7µs | 16µs | DBIx::Class::Componentised::BEGIN@8 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package # hide from PAUSE | ||||
| 2 | DBIx::Class::Componentised; | ||||
| 3 | |||||
| 4 | 3 | 20µs | 2 | 26µs | # spent 21µs (16+5) within DBIx::Class::Componentised::BEGIN@4 which was called:
# once (16µs+5µs) by base::import at line 4 # spent 21µs making 1 call to DBIx::Class::Componentised::BEGIN@4
# spent 5µs making 1 call to strict::import |
| 5 | 3 | 20µs | 2 | 39µs | # spent 24µs (8+16) within DBIx::Class::Componentised::BEGIN@5 which was called:
# once (8µs+16µs) by base::import at line 5 # spent 24µs making 1 call to DBIx::Class::Componentised::BEGIN@5
# spent 16µs making 1 call to warnings::import |
| 6 | |||||
| 7 | 3 | 22µs | 2 | 1.02ms | # spent 1.02ms (8µs+1.01) within DBIx::Class::Componentised::BEGIN@7 which was called:
# once (8µs+1.01ms) by base::import at line 7 # spent 1.02ms making 1 call to DBIx::Class::Componentised::BEGIN@7
# spent 1.01ms making 1 call to base::import, recursion: max depth 1, sum of overlapping time 1.01ms |
| 8 | 3 | 21µs | 2 | 26µs | # spent 16µs (7+9) within DBIx::Class::Componentised::BEGIN@8 which was called:
# once (7µs+9µs) by base::import at line 8 # spent 16µs making 1 call to DBIx::Class::Componentised::BEGIN@8
# spent 9µs making 1 call to mro::import |
| 9 | |||||
| 10 | 3 | 122µs | 2 | 888µs | # spent 784µs (618+166) within DBIx::Class::Componentised::BEGIN@10 which was called:
# once (618µs+166µs) by base::import at line 10 # spent 784µs making 1 call to DBIx::Class::Componentised::BEGIN@10
# spent 104µs making 1 call to DBIx::Class::Carp::import |
| 11 | |||||
| 12 | # this warns of subtle bugs introduced by UTF8Columns hacky handling of store_column | ||||
| 13 | # if and only if it is placed before something overriding store_column | ||||
| 14 | # spent 10.0ms (2.21+7.82) within DBIx::Class::Componentised::inject_base which was called 42 times, avg 239µs/call:
# 42 times (2.21ms+7.82ms) by Class::C3::Componentised::_load_components at line 95 of Class/C3/Componentised.pm, avg 239µs/call | ||||
| 15 | 854 | 2.58ms | my $class = shift; | ||
| 16 | my ($target, @complist) = @_; | ||||
| 17 | |||||
| 18 | # we already did load the component | ||||
| 19 | 84 | 215µs | my $keep_checking = ! ( # spent 215µs making 84 calls to UNIVERSAL::isa, avg 3µs/call | ||
| 20 | $target->isa ('DBIx::Class::UTF8Columns') | ||||
| 21 | || | ||||
| 22 | $target->isa ('DBIx::Class::ForceUTF8') | ||||
| 23 | ); | ||||
| 24 | |||||
| 25 | my @target_isa; | ||||
| 26 | |||||
| 27 | while ($keep_checking && @complist) { | ||||
| 28 | |||||
| 29 | 3 | 192µs | 2 | 25µs | # spent 16µs (7+9) within DBIx::Class::Componentised::BEGIN@29 which was called:
# once (7µs+9µs) by base::import at line 29 # spent 16µs making 1 call to DBIx::Class::Componentised::BEGIN@29
# spent 9µs making 1 call to strict::unimport |
| 30 | unless @target_isa; | ||||
| 31 | |||||
| 32 | my $comp = pop @complist; | ||||
| 33 | |||||
| 34 | # warn here on use of either component, as we have no access to ForceUTF8, | ||||
| 35 | # the author does not respond, and the Catalyst wiki used to recommend it | ||||
| 36 | for (qw/DBIx::Class::UTF8Columns DBIx::Class::ForceUTF8/) { | ||||
| 37 | 160 | 298µs | if ($comp->isa ($_) ) { # spent 298µs making 160 calls to UNIVERSAL::isa, avg 2µs/call | ||
| 38 | $keep_checking = 0; # no use to check from this point on | ||||
| 39 | carp_once "Use of $_ is strongly discouraged. See documentation of DBIx::Class::UTF8Columns for more info\n" | ||||
| 40 | unless $ENV{DBIC_UTF8COLUMNS_OK}; | ||||
| 41 | last; | ||||
| 42 | } | ||||
| 43 | } | ||||
| 44 | |||||
| 45 | # something unset $keep_checking - we got a unicode mangler | ||||
| 46 | if (! $keep_checking) { | ||||
| 47 | |||||
| 48 | my $base_store_column = do { require DBIx::Class::Row; DBIx::Class::Row->can ('store_column') }; | ||||
| 49 | |||||
| 50 | my @broken; | ||||
| 51 | for my $existing_comp (@target_isa) { | ||||
| 52 | my $sc = $existing_comp->can ('store_column') | ||||
| 53 | or next; | ||||
| 54 | |||||
| 55 | if ($sc ne $base_store_column) { | ||||
| 56 | require B; | ||||
| 57 | my $definer = B::svref_2object($sc)->STASH->NAME; | ||||
| 58 | push @broken, ($definer eq $existing_comp) | ||||
| 59 | ? $existing_comp | ||||
| 60 | : "$existing_comp (via $definer)" | ||||
| 61 | ; | ||||
| 62 | } | ||||
| 63 | } | ||||
| 64 | |||||
| 65 | carp "Incorrect loading order of $comp by $target will affect other components overriding 'store_column' (" | ||||
| 66 | . join (', ', @broken) | ||||
| 67 | .'). Refer to the documentation of DBIx::Class::UTF8Columns for more info' | ||||
| 68 | if @broken; | ||||
| 69 | } | ||||
| 70 | |||||
| 71 | unshift @target_isa, $comp; | ||||
| 72 | } | ||||
| 73 | |||||
| 74 | 42 | 702µs | $class->next::method(@_); # spent 702µs making 42 calls to next::method, avg 17µs/call | ||
| 75 | } | ||||
| 76 | |||||
| 77 | 1 | 8µs | 1 | 242µs | 1; # spent 242µs making 1 call to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:26] |