Filename | /Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Moose/Meta/Method.pm |
Statements | Executed 310 statements in 748µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
47 | 5 | 4 | 448µs | 8.55ms | _inline_throw_error | Moose::Meta::Method::
1 | 1 | 1 | 8µs | 8µs | BEGIN@2 | Moose::Meta::Method::
1 | 1 | 1 | 7µs | 65µs | BEGIN@14 | Moose::Meta::Method::
1 | 1 | 1 | 6µs | 9µs | BEGIN@10 | Moose::Meta::Method::
1 | 1 | 1 | 6µs | 16µs | BEGIN@9 | Moose::Meta::Method::
1 | 1 | 1 | 4µs | 4µs | BEGIN@12 | Moose::Meta::Method::
0 | 0 | 0 | 0s | 0s | _error_thrower | Moose::Meta::Method::
0 | 0 | 0 | 0s | 0s | throw_error | Moose::Meta::Method::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Moose::Meta::Method; | ||||
2 | # spent 8µs within Moose::Meta::Method::BEGIN@2 which was called:
# once (8µs+0s) by base::import at line 4 | ||||
3 | 1 | 4µs | $Moose::Meta::Method::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 32µs | 1 | 8µs | } # spent 8µs making 1 call to Moose::Meta::Method::BEGIN@2 |
5 | { | ||||
6 | 2 | 700ns | $Moose::Meta::Method::VERSION = '2.1005'; | ||
7 | } | ||||
8 | |||||
9 | 2 | 32µs | 2 | 27µs | # spent 16µs (6+11) within Moose::Meta::Method::BEGIN@9 which was called:
# once (6µs+11µs) by base::import at line 9 # spent 16µs making 1 call to Moose::Meta::Method::BEGIN@9
# spent 11µs making 1 call to strict::import |
10 | 2 | 20µs | 2 | 12µs | # spent 9µs (6+3) within Moose::Meta::Method::BEGIN@10 which was called:
# once (6µs+3µs) by base::import at line 10 # spent 9µs making 1 call to Moose::Meta::Method::BEGIN@10
# spent 3µs making 1 call to warnings::import |
11 | |||||
12 | 2 | 20µs | 1 | 4µs | # spent 4µs within Moose::Meta::Method::BEGIN@12 which was called:
# once (4µs+0s) by base::import at line 12 # spent 4µs making 1 call to Moose::Meta::Method::BEGIN@12 |
13 | |||||
14 | 2 | 221µs | 2 | 65µs | # spent 65µs (7+58) within Moose::Meta::Method::BEGIN@14 which was called:
# once (7µs+58µs) by base::import at line 14 # spent 65µs making 1 call to Moose::Meta::Method::BEGIN@14
# spent 58µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 58µs |
15 | |||||
16 | 1 | 2µs | 1 | 1.58ms | Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait'); # spent 1.58ms making 1 call to Class::MOP::MiniTrait::apply |
17 | |||||
18 | sub _error_thrower { | ||||
19 | my $self = shift; | ||||
20 | require Moose::Meta::Class; | ||||
21 | ( ref $self && $self->associated_metaclass ) || "Moose::Meta::Class"; | ||||
22 | } | ||||
23 | |||||
24 | sub throw_error { | ||||
25 | my $self = shift; | ||||
26 | my $inv = $self->_error_thrower; | ||||
27 | unshift @_, "message" if @_ % 2 == 1; | ||||
28 | unshift @_, method => $self if ref $self; | ||||
29 | unshift @_, $inv; | ||||
30 | my $handler = $inv->can("throw_error"); | ||||
31 | goto $handler; # to avoid incrementing depth by 1 | ||||
32 | } | ||||
33 | |||||
34 | # spent 8.55ms (448µs+8.10) within Moose::Meta::Method::_inline_throw_error which was called 47 times, avg 182µs/call:
# 22 times (176µs+5.84ms) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 90 of Moose/Meta/Method/Accessor/Native.pm, avg 273µs/call
# 9 times (77µs+782µs) by Moose::Meta::Method::Accessor::Native::_inline_check_argument_count at line 75 of Moose/Meta/Method/Accessor/Native.pm, avg 95µs/call
# 9 times (61µs+737µs) by Moose::Meta::Method::Accessor::Native::Array::_inline_check_var_is_valid_index at line 21 of Moose/Meta/Method/Accessor/Native/Array.pm, avg 89µs/call
# 5 times (112µs+573µs) by Class::MOP::Method::Accessor::try {...} at line 142 of Class/MOP/Method/Accessor.pm, avg 137µs/call
# 2 times (22µs+174µs) by Moose::Meta::Method::Accessor::Native::Collection::_inline_check_member_constraint at line 114 of Moose/Meta/Method/Accessor/Native/Collection.pm, avg 98µs/call | ||||
35 | 47 | 14µs | my ( $self, $msg, $args ) = @_; | ||
36 | |||||
37 | 47 | 48µs | 47 | 262µs | my $inv = $self->_error_thrower; # spent 262µs making 47 calls to Moose::Meta::Method::Accessor::_error_thrower, avg 6µs/call |
38 | # XXX ugh | ||||
39 | 47 | 108µs | 47 | 36µs | $inv = 'Moose::Meta::Class' unless $inv->can('_inline_throw_error'); # spent 36µs making 47 calls to UNIVERSAL::can, avg 755ns/call |
40 | |||||
41 | # XXX ugh ugh UGH | ||||
42 | 47 | 56µs | 47 | 44µs | my $class = $self->associated_metaclass; # spent 44µs making 47 calls to Class::MOP::Method::associated_metaclass, avg 936ns/call |
43 | 47 | 4µs | if ($class) { | ||
44 | 5 | 42µs | 10 | 22µs | my $class_name = B::perlstring($class->name); # spent 19µs making 5 calls to B::perlstring, avg 4µs/call
# spent 3µs making 5 calls to Class::MOP::Package::name, avg 580ns/call |
45 | 5 | 24µs | 10 | 6µs | my $meth_name = B::perlstring($self->name); # spent 4µs making 5 calls to B::perlstring, avg 720ns/call
# spent 2µs making 5 calls to Class::MOP::Method::name, avg 480ns/call |
46 | 5 | 8µs | $args = 'method => Class::MOP::class_of(' . $class_name . ')' | ||
47 | . '->find_method_by_name(' . $meth_name . '), ' | ||||
48 | . (defined $args ? $args : ''); | ||||
49 | } | ||||
50 | |||||
51 | 47 | 107µs | 47 | 7.73ms | return $inv->_inline_throw_error($msg, $args) # spent 7.73ms making 47 calls to Moose::Meta::Attribute::_inline_throw_error, avg 165µs/call |
52 | } | ||||
53 | |||||
54 | 1 | 4µs | 1; | ||
55 | |||||
56 | # ABSTRACT: A Moose Method metaclass | ||||
57 | |||||
58 | __END__ |