Filename | /opt/perl-5.18.1/lib/site_perl/5.18.1/darwin-thread-multi-2level/Moose/Meta/Method.pm |
Statements | Executed 31 statements in 581µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 86µs | 573µs | _inline_throw_error | Moose::Meta::Method::
1 | 1 | 1 | 11µs | 11µs | BEGIN@2 | Moose::Meta::Method::
1 | 1 | 1 | 9µs | 14µs | BEGIN@10 | Moose::Meta::Method::
1 | 1 | 1 | 9µs | 88µs | BEGIN@14 | Moose::Meta::Method::
1 | 1 | 1 | 8µs | 24µs | BEGIN@9 | Moose::Meta::Method::
1 | 1 | 1 | 5µs | 5µ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 11µs within Moose::Meta::Method::BEGIN@2 which was called:
# once (11µs+0s) by base::import at line 4 | ||||
3 | 1 | 7µs | $Moose::Meta::Method::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 45µs | 1 | 11µs | } # spent 11µs making 1 call to Moose::Meta::Method::BEGIN@2 |
5 | { | ||||
6 | 2 | 1µs | $Moose::Meta::Method::VERSION = '2.1005'; | ||
7 | } | ||||
8 | |||||
9 | 2 | 30µs | 2 | 40µs | # spent 24µs (8+16) within Moose::Meta::Method::BEGIN@9 which was called:
# once (8µs+16µs) by base::import at line 9 # spent 24µs making 1 call to Moose::Meta::Method::BEGIN@9
# spent 16µs making 1 call to strict::import |
10 | 2 | 34µs | 2 | 18µs | # spent 14µs (9+4) within Moose::Meta::Method::BEGIN@10 which was called:
# once (9µs+4µs) by base::import at line 10 # spent 14µs making 1 call to Moose::Meta::Method::BEGIN@10
# spent 4µs making 1 call to warnings::import |
11 | |||||
12 | 2 | 33µs | 1 | 5µs | # spent 5µs within Moose::Meta::Method::BEGIN@12 which was called:
# once (5µs+0s) by base::import at line 12 # spent 5µs making 1 call to Moose::Meta::Method::BEGIN@12 |
13 | |||||
14 | 2 | 320µs | 2 | 88µs | # spent 88µs (9+79) within Moose::Meta::Method::BEGIN@14 which was called:
# once (9µs+79µs) by base::import at line 14 # spent 88µs making 1 call to Moose::Meta::Method::BEGIN@14
# spent 79µs making 1 call to base::import, recursion: max depth 1, sum of overlapping time 79µs |
15 | |||||
16 | 1 | 2µs | 1 | 2.27ms | Class::MOP::MiniTrait::apply(__PACKAGE__, 'Moose::Meta::Object::Trait'); # spent 2.27ms 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 573µs (86+487) within Moose::Meta::Method::_inline_throw_error which was called 2 times, avg 287µs/call:
# 2 times (86µs+487µs) by Class::MOP::Method::Accessor::try {...} at line 142 of Class/MOP/Method/Accessor.pm, avg 287µs/call | ||||
35 | 2 | 1µs | my ( $self, $msg, $args ) = @_; | ||
36 | |||||
37 | 2 | 4µs | 2 | 20µs | my $inv = $self->_error_thrower; # spent 20µs making 2 calls to Moose::Meta::Method::Accessor::_error_thrower, avg 10µs/call |
38 | # XXX ugh | ||||
39 | 2 | 14µs | 2 | 3µs | $inv = 'Moose::Meta::Class' unless $inv->can('_inline_throw_error'); # spent 3µs making 2 calls to UNIVERSAL::can, avg 1µs/call |
40 | |||||
41 | # XXX ugh ugh UGH | ||||
42 | 2 | 6µs | 2 | 4µs | my $class = $self->associated_metaclass; # spent 4µs making 2 calls to Class::MOP::Method::associated_metaclass, avg 2µs/call |
43 | 2 | 1µs | if ($class) { | ||
44 | 2 | 34µs | 4 | 16µs | my $class_name = B::perlstring($class->name); # spent 14µs making 2 calls to B::perlstring, avg 7µs/call
# spent 2µs making 2 calls to Class::MOP::Package::name, avg 900ns/call |
45 | 2 | 21µs | 4 | 4µs | my $meth_name = B::perlstring($self->name); # spent 3µs making 2 calls to B::perlstring, avg 1µs/call
# spent 1µs making 2 calls to Class::MOP::Method::name, avg 600ns/call |
46 | 2 | 6µs | $args = 'method => Class::MOP::class_of(' . $class_name . ')' | ||
47 | . '->find_method_by_name(' . $meth_name . '), ' | ||||
48 | . (defined $args ? $args : ''); | ||||
49 | } | ||||
50 | |||||
51 | 2 | 14µs | 2 | 441µs | return $inv->_inline_throw_error($msg, $args) # spent 441µs making 2 calls to Moose::Meta::Attribute::_inline_throw_error, avg 221µs/call |
52 | } | ||||
53 | |||||
54 | 1 | 6µs | 1; | ||
55 | |||||
56 | # ABSTRACT: A Moose Method metaclass | ||||
57 | |||||
58 | __END__ |