| Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Error/Default.pm |
| Statements | Executed 461 statements in 1.09ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 148 | 1 | 1 | 539µs | 539µs | Moose::Error::Default::_inline_new |
| 1 | 1 | 1 | 286µs | 320µs | Moose::Error::Default::BEGIN@15 |
| 1 | 1 | 1 | 106µs | 113µs | Moose::Error::Default::BEGIN@12 |
| 1 | 1 | 1 | 8µs | 8µs | Moose::Error::Default::BEGIN@2 |
| 1 | 1 | 1 | 7µs | 58µs | Moose::Error::Default::BEGIN@17 |
| 1 | 1 | 1 | 7µs | 10µs | Moose::Error::Default::BEGIN@10 |
| 1 | 1 | 1 | 6µs | 17µs | Moose::Error::Default::BEGIN@9 |
| 1 | 1 | 1 | 4µs | 4µs | Moose::Error::Default::BEGIN@13 |
| 0 | 0 | 0 | 0s | 0s | Moose::Error::Default::create_error_confess |
| 0 | 0 | 0 | 0s | 0s | Moose::Error::Default::create_error_croak |
| 0 | 0 | 0 | 0s | 0s | Moose::Error::Default::new |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Moose::Error::Default; | ||||
| 2 | # spent 8µs within Moose::Error::Default::BEGIN@2 which was called:
# once (8µs+0s) by Moose::Meta::Class::BEGIN@23 at line 4 | ||||
| 3 | 1 | 4µs | $Moose::Error::Default::AUTHORITY = 'cpan:STEVAN'; | ||
| 4 | 1 | 31µs | 1 | 8µs | } # spent 8µs making 1 call to Moose::Error::Default::BEGIN@2 |
| 5 | { | ||||
| 6 | 2 | 900ns | $Moose::Error::Default::VERSION = '2.1005'; | ||
| 7 | } | ||||
| 8 | |||||
| 9 | 2 | 22µs | 2 | 28µs | # spent 17µs (6+11) within Moose::Error::Default::BEGIN@9 which was called:
# once (6µs+11µs) by Moose::Meta::Class::BEGIN@23 at line 9 # spent 17µs making 1 call to Moose::Error::Default::BEGIN@9
# spent 11µs making 1 call to strict::import |
| 10 | 2 | 24µs | 2 | 13µs | # spent 10µs (7+3) within Moose::Error::Default::BEGIN@10 which was called:
# once (7µs+3µs) by Moose::Meta::Class::BEGIN@23 at line 10 # spent 10µs making 1 call to Moose::Error::Default::BEGIN@10
# spent 3µs making 1 call to warnings::import |
| 11 | |||||
| 12 | 2 | 94µs | 1 | 113µs | # spent 113µs (106+7) within Moose::Error::Default::BEGIN@12 which was called:
# once (106µs+7µs) by Moose::Meta::Class::BEGIN@23 at line 12 # spent 113µs making 1 call to Moose::Error::Default::BEGIN@12 |
| 13 | 2 | 20µs | 1 | 4µs | # spent 4µs within Moose::Error::Default::BEGIN@13 which was called:
# once (4µs+0s) by Moose::Meta::Class::BEGIN@23 at line 13 # spent 4µs making 1 call to Moose::Error::Default::BEGIN@13 |
| 14 | |||||
| 15 | 2 | 90µs | 1 | 320µs | # spent 320µs (286+34) within Moose::Error::Default::BEGIN@15 which was called:
# once (286µs+34µs) by Moose::Meta::Class::BEGIN@23 at line 15 # spent 320µs making 1 call to Moose::Error::Default::BEGIN@15 |
| 16 | |||||
| 17 | 2 | 195µs | 2 | 109µs | # spent 58µs (7+51) within Moose::Error::Default::BEGIN@17 which was called:
# once (7µs+51µs) by Moose::Meta::Class::BEGIN@23 at line 17 # spent 58µs making 1 call to Moose::Error::Default::BEGIN@17
# spent 51µs making 1 call to base::import |
| 18 | |||||
| 19 | 1 | 2µs | 1 | 4.07ms | Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait'); # spent 4.07ms making 1 call to Class::MOP::MiniTrait::apply |
| 20 | |||||
| 21 | sub new { | ||||
| 22 | my ( $self, @args ) = @_; | ||||
| 23 | # can't use Moose::Error::Util::create_error here because that would break | ||||
| 24 | # inheritance. we don't care about that for the inlined version, because | ||||
| 25 | # the inlined versions are explicitly not inherited. | ||||
| 26 | if (defined $ENV{MOOSE_ERROR_STYLE} && $ENV{MOOSE_ERROR_STYLE} eq 'croak') { | ||||
| 27 | $self->create_error_croak( @args ); | ||||
| 28 | } | ||||
| 29 | else { | ||||
| 30 | $self->create_error_confess( @args ); | ||||
| 31 | } | ||||
| 32 | } | ||||
| 33 | |||||
| 34 | # spent 539µs within Moose::Error::Default::_inline_new which was called 148 times, avg 4µs/call:
# 148 times (539µs+0s) by Moose::Meta::Class::_inline_create_error at line 855 of Moose/Meta/Class.pm, avg 4µs/call | ||||
| 35 | 148 | 152µs | my ( $self, %args ) = @_; | ||
| 36 | |||||
| 37 | 148 | 55µs | my $depth = ($args{depth} || 0) - 1; | ||
| 38 | 148 | 395µs | return 'Moose::Error::Util::create_error(' | ||
| 39 | . 'message => ' . $args{message} . ', ' | ||||
| 40 | . 'depth => ' . $depth . ', ' | ||||
| 41 | . ')'; | ||||
| 42 | } | ||||
| 43 | |||||
| 44 | sub create_error_croak { | ||||
| 45 | my ( $self, @args ) = @_; | ||||
| 46 | return Moose::Error::Util::create_error_croak(@args); | ||||
| 47 | } | ||||
| 48 | |||||
| 49 | sub create_error_confess { | ||||
| 50 | my ( $self, @args ) = @_; | ||||
| 51 | return Moose::Error::Util::create_error_confess(@args); | ||||
| 52 | } | ||||
| 53 | |||||
| 54 | 1 | 4µs | 1; | ||
| 55 | |||||
| 56 | # ABSTRACT: L<Carp> based error generation for Moose. | ||||
| 57 | |||||
| 58 | __END__ |