← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/site_perl/5.18.0/darwin-thread-multi-2level/Class/MOP/Method/Overload.pm
StatementsExecuted 12 statements in 261µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1118µs28µsClass::MOP::Method::Overload::::BEGIN@13Class::MOP::Method::Overload::BEGIN@13
1118µs8µsClass::MOP::Method::Overload::::BEGIN@3Class::MOP::Method::Overload::BEGIN@3
1116µs9µsClass::MOP::Method::Overload::::BEGIN@11Class::MOP::Method::Overload::BEGIN@11
1116µs16µsClass::MOP::Method::Overload::::BEGIN@10Class::MOP::Method::Overload::BEGIN@10
1115µs51µsClass::MOP::Method::Overload::::BEGIN@15Class::MOP::Method::Overload::BEGIN@15
0000s0sClass::MOP::Method::Overload::::_newClass::MOP::Method::Overload::_new
0000s0sClass::MOP::Method::Overload::::wrapClass::MOP::Method::Overload::wrap
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package Class::MOP::Method::Overload;
3
# spent 8µs within Class::MOP::Method::Overload::BEGIN@3 which was called: # once (8µs+0s) by Class::MOP::Mixin::HasMethods::BEGIN@13 at line 5
BEGIN {
414µs $Class::MOP::Method::Overload::AUTHORITY = 'cpan:STEVAN';
5128µs18µs}
# spent 8µs making 1 call to Class::MOP::Method::Overload::BEGIN@3
6{
72800ns $Class::MOP::Method::Overload::VERSION = '2.1005';
8}
9
10219µs226µs
# spent 16µs (6+10) within Class::MOP::Method::Overload::BEGIN@10 which was called: # once (6µs+10µs) by Class::MOP::Mixin::HasMethods::BEGIN@13 at line 10
use strict;
# spent 16µs making 1 call to Class::MOP::Method::Overload::BEGIN@10 # spent 10µs making 1 call to strict::import
11222µs212µs
# spent 9µs (6+3) within Class::MOP::Method::Overload::BEGIN@11 which was called: # once (6µs+3µs) by Class::MOP::Mixin::HasMethods::BEGIN@13 at line 11
use warnings;
# spent 9µs making 1 call to Class::MOP::Method::Overload::BEGIN@11 # spent 3µs making 1 call to warnings::import
12
13224µs249µs
# spent 28µs (8+21) within Class::MOP::Method::Overload::BEGIN@13 which was called: # once (8µs+21µs) by Class::MOP::Mixin::HasMethods::BEGIN@13 at line 13
use Carp 'confess';
# spent 28µs making 1 call to Class::MOP::Method::Overload::BEGIN@13 # spent 21µs making 1 call to Exporter::import
14
152160µs297µs
# spent 51µs (5+46) within Class::MOP::Method::Overload::BEGIN@15 which was called: # once (5µs+46µs) by Class::MOP::Mixin::HasMethods::BEGIN@13 at line 15
use base 'Class::MOP::Method';
# spent 51µs making 1 call to Class::MOP::Method::Overload::BEGIN@15 # spent 46µs making 1 call to base::import
16
17sub wrap {
18 my $class = shift;
19 my (@args) = @_;
20 unshift @args, 'body' if @args % 2 == 1;
21 my %params = @args;
22
23 confess "operator is required"
24 unless exists $params{operator};
25
26 return $class->SUPER::wrap(
27 name => "($params{operator}",
28 %params,
29 );
30}
31
32sub _new {
33 my $class = shift;
34 return Class::MOP::Class->initialize($class)->new_object(@_)
35 if $class ne __PACKAGE__;
36
37 my $params = @_ == 1 ? $_[0] : {@_};
38
39 return bless {
40 # inherited from Class::MOP::Method
41 'body' => $params->{body},
42 'associated_metaclass' => $params->{associated_metaclass},
43 'package_name' => $params->{package_name},
44 'name' => $params->{name},
45 'original_method' => $params->{original_method},
46
47 # defined in this class
48 'operator' => $params->{operator},
49 } => $class;
50}
51
5212µs1;
53
54# ABSTRACT: Method Meta Object for methods which implement overloading
55
56__END__