← Index
NYTProf Performance Profile   « block view • line view • sub view »
For -e
  Run on Wed Nov 17 21:45:08 2010
Reported on Wed Nov 17 22:13:41 2010

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/Moose/Error/Default.pm
StatementsExecuted 20 statements in 2.04ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1115.35ms5.88msMoose::Error::Default::::BEGIN@10Moose::Error::Default::BEGIN@10
111106µs132µsMoose::Error::Default::::BEGIN@3Moose::Error::Default::BEGIN@3
11160µs180µsMoose::Error::Default::::BEGIN@4Moose::Error::Default::BEGIN@4
11137µs282µsMoose::Error::Default::::BEGIN@13Moose::Error::Default::BEGIN@13
11127µs27µsMoose::Error::Default::::BEGIN@11Moose::Error::Default::BEGIN@11
0000s0sMoose::Error::Default::::_create_error_carpmessMoose::Error::Default::_create_error_carpmess
0000s0sMoose::Error::Default::::create_error_confessMoose::Error::Default::create_error_confess
0000s0sMoose::Error::Default::::create_error_croakMoose::Error::Default::create_error_croak
0000s0sMoose::Error::Default::::newMoose::Error::Default::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Moose::Error::Default;
2
33159µs2157µs
# spent 132µs (106+26) within Moose::Error::Default::BEGIN@3 which was called: # once (106µs+26µs) by Moose::Meta::Class::BEGIN@21 at line 3
use strict;
# spent 132µs making 1 call to Moose::Error::Default::BEGIN@3 # spent 26µs making 1 call to strict::import
43337µs2300µs
# spent 180µs (60+120) within Moose::Error::Default::BEGIN@4 which was called: # once (60µs+120µs) by Moose::Meta::Class::BEGIN@21 at line 4
use warnings;
# spent 180µs making 1 call to Moose::Error::Default::BEGIN@4 # spent 120µs making 1 call to warnings::import
5
614µsour $VERSION = '1.19';
7162µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
813µsour $AUTHORITY = 'cpan:STEVAN';
9
103530µs15.88ms
# spent 5.88ms (5.35+524µs) within Moose::Error::Default::BEGIN@10 which was called: # once (5.35ms+524µs) by Moose::Meta::Class::BEGIN@21 at line 10
use Carp::Heavy;
# spent 5.88ms making 1 call to Moose::Error::Default::BEGIN@10
11396µs127µs
# spent 27µs within Moose::Error::Default::BEGIN@11 which was called: # once (27µs+0s) by Moose::Meta::Class::BEGIN@21 at line 11
use Class::MOP::MiniTrait;
# spent 27µs making 1 call to Moose::Error::Default::BEGIN@11
12
133816µs2527µs
# spent 282µs (37+245) within Moose::Error::Default::BEGIN@13 which was called: # once (37µs+245µs) by Moose::Meta::Class::BEGIN@21 at line 13
use base 'Class::MOP::Object';
# spent 282µs making 1 call to Moose::Error::Default::BEGIN@13 # spent 245µs making 1 call to base::import
14
15114µs17.59msClass::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait');
# spent 7.59ms making 1 call to Class::MOP::MiniTrait::apply
16
17sub new {
18 my ( $self, @args ) = @_;
19 if (defined $ENV{MOOSE_ERROR_STYLE} && $ENV{MOOSE_ERROR_STYLE} eq 'croak') {
20 $self->create_error_croak( @args );
21 }
22 else {
23 $self->create_error_confess( @args );
24 }
25}
26
27sub create_error_croak {
28 my ( $self, @args ) = @_;
29 $self->_create_error_carpmess( @args );
30}
31
32sub create_error_confess {
33 my ( $self, @args ) = @_;
34 $self->_create_error_carpmess( @args, longmess => 1 );
35}
36
37sub _create_error_carpmess {
38 my ( $self, %args ) = @_;
39
40 my $carp_level = 3 + ( $args{depth} || 1 );
41 local $Carp::MaxArgNums = 20; # default is 8, usually we use named args which gets messier though
42
43 my @args = exists $args{message} ? $args{message} : ();
44
45 if ( $args{longmess} || $Carp::Verbose ) {
46 local $Carp::CarpLevel = ( $Carp::CarpLevel || 0 ) + $carp_level;
47 return Carp::longmess(@args);
48 } else {
49 return Carp::ret_summary($carp_level, @args);
50 }
51}
52
53122µs__PACKAGE__
54
55__END__