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