← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:10 2016

Filename/usr/local/lib/perl/5.18.2/metaclass.pm
StatementsExecuted 231 statements in 609µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
202020321µs17.7msmetaclass::::importmetaclass::import
1118µs17µsmetaclass::::BEGIN@4metaclass::BEGIN@4
1116µs24µsmetaclass::::BEGIN@7metaclass::BEGIN@7
1116µs8µsmetaclass::::BEGIN@5metaclass::BEGIN@5
1115µs5µsmetaclass::::BEGIN@8metaclass::BEGIN@8
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package metaclass;
21500nsour $VERSION = '2.1604';
3
4218µs225µs
# spent 17µs (8+9) within metaclass::BEGIN@4 which was called: # once (8µs+9µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 4
use strict;
# spent 17µs making 1 call to metaclass::BEGIN@4 # spent 9µs making 1 call to strict::import
5221µs211µs
# spent 8µs (6+3) within metaclass::BEGIN@5 which was called: # once (6µs+3µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 5
use warnings;
# spent 8µs making 1 call to metaclass::BEGIN@5 # spent 3µs making 1 call to warnings::import
6
7221µs241µs
# spent 24µs (6+17) within metaclass::BEGIN@7 which was called: # once (6µs+17µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 7
use Module::Runtime 'use_package_optimistically', 'use_module';
# spent 24µs making 1 call to metaclass::BEGIN@7 # spent 17µs making 1 call to Module::Runtime::import
82184µs15µs
# spent 5µs within metaclass::BEGIN@8 which was called: # once (5µs+0s) by Moose::Meta::TypeConstraint::BEGIN@6 at line 8
use Class::MOP;
# spent 5µs making 1 call to metaclass::BEGIN@8
9
10
# spent 17.7ms (321µs+17.4) within metaclass::import which was called 20 times, avg 885µs/call: # once (13µs+5.44ms) by Moose::Meta::TypeConstraint::Enum::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Enum.pm # once (14µs+3.74ms) by Moose::Meta::Role::Application::BEGIN@6 at line 6 of Moose/Meta/Role/Application.pm # once (33µs+1.71ms) by Moose::Object::BEGIN@16 at line 15 of if.pm # once (15µs+466µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint.pm # once (19µs+455µs) by Moose::Meta::TypeConstraint::Union::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Union.pm # once (17µs+418µs) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Parameterized.pm # once (17µs+415µs) by Moose::Meta::TypeConstraint::DuckType::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/DuckType.pm # once (17µs+410µs) by Moose::Meta::TypeCoercion::BEGIN@6 at line 6 of Moose/Meta/TypeCoercion.pm # once (19µs+393µs) by Moose::Meta::Role::Composite::BEGIN@6 at line 6 of Moose/Meta/Role/Composite.pm # once (16µs+395µs) by Moose::Meta::TypeConstraint::Registry::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Registry.pm # once (16µs+377µs) by Moose::Meta::Role::Application::ToClass::BEGIN@6 at line 6 of Moose/Meta/Role/Application/ToClass.pm # once (14µs+370µs) by Moose::Meta::TypeConstraint::Class::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Class.pm # once (16µs+367µs) by Moose::Meta::Role::Application::RoleSummation::BEGIN@6 at line 6 of Moose/Meta/Role/Application/RoleSummation.pm # once (17µs+362µs) by Moose::Meta::Role::Method::Required::BEGIN@6 at line 6 of Moose/Meta/Role/Method/Required.pm # once (14µs+361µs) by Moose::Meta::Role::Application::ToRole::BEGIN@6 at line 6 of Moose/Meta/Role/Application/ToRole.pm # once (13µs+358µs) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Parameterizable.pm # once (15µs+354µs) by Moose::Meta::Role::BEGIN@6 at line 6 of Moose/Meta/Role.pm # once (13µs+338µs) by Moose::Meta::Role::Application::ToInstance::BEGIN@6 at line 6 of Moose/Meta/Role/Application/ToInstance.pm # once (12µs+333µs) by Moose::Meta::TypeConstraint::Role::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Role.pm # once (12µs+309µs) by Moose::Meta::TypeCoercion::Union::BEGIN@6 at line 6 of Moose/Meta/TypeCoercion/Union.pm
sub import {
112016µs my ( $class, @args ) = @_;
12
132016µs unshift @args, "metaclass" if @args % 2 == 1;
142014µs my %options = @args;
15
162014µs my $meta_name = exists $options{meta_name} ? $options{meta_name} : 'meta';
172011µs my $metaclass = delete $options{metaclass};
18
192013µs unless ( defined $metaclass ) {
20 $metaclass = "Class::MOP::Class";
21 } else {
221900ns140µs use_package_optimistically($metaclass);
# spent 40µs making 1 call to Module::Runtime::use_package_optimistically
23 }
24
252094µs2028µs ($metaclass->isa('Class::MOP::Class'))
# spent 28µs making 20 calls to UNIVERSAL::isa, avg 1µs/call
26 || die use_module('Moose::Exception::MetaclassMustBeDerivedFromClassMOPClass')->new( class_name => $metaclass );
27
28 # make sure the custom metaclasses get loaded
292031µs foreach my $key (grep { /_(?:meta)?class$/ } keys %options) {
30 unless ( ref( my $class = $options{$key} ) ) {
31 use_package_optimistically($class)
32 }
33 }
34
352013µs my $package = caller();
36
37 # create a meta object so we can install &meta
382031µs202.09ms my $meta = $metaclass->initialize($package => %options);
# spent 1.31ms making 19 calls to Class::MOP::Class::initialize, avg 69µs/call # spent 778µs making 1 call to Moose::Meta::Class::initialize
3920107µs2015.2ms $meta->_add_meta_method($meta_name)
# spent 15.2ms making 20 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 761µs/call
40 if defined $meta_name;
41}
42
4312µs1;
44
45# ABSTRACT: a pragma for installing and using Class::MOP metaclasses
46
47__END__