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

Filename/home/doy/coding/src/Class-MOP/blib/lib//metaclass.pm
StatementsExecuted 243 statements in 3.84ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2020202.08ms67.3msmetaclass::::importmetaclass::import
11162µs78µsmetaclass::::BEGIN@4metaclass::BEGIN@4
11139µs104µsmetaclass::::BEGIN@5metaclass::BEGIN@5
11137µs195µsmetaclass::::BEGIN@7metaclass::BEGIN@7
11137µs207µsmetaclass::::BEGIN@9metaclass::BEGIN@9
11136µs164µsmetaclass::::BEGIN@8metaclass::BEGIN@8
11126µs26µsmetaclass::::BEGIN@15metaclass::BEGIN@15
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package metaclass;
3
4395µs293µs
# spent 78µs (62+15) within metaclass::BEGIN@4 which was called: # once (62µs+15µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 4
use strict;
# spent 78µs making 1 call to metaclass::BEGIN@4 # spent 15µs making 1 call to strict::import
53107µs2168µs
# spent 104µs (39+65) within metaclass::BEGIN@5 which was called: # once (39µs+65µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 5
use warnings;
# spent 104µs making 1 call to metaclass::BEGIN@5 # spent 65µs making 1 call to warnings::import
6
73103µs2352µs
# spent 195µs (37+157) within metaclass::BEGIN@7 which was called: # once (37µs+157µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 7
use Carp 'confess';
# spent 195µs making 1 call to metaclass::BEGIN@7 # spent 157µs making 1 call to Exporter::import
8395µs2292µs
# spent 164µs (36+128) within metaclass::BEGIN@8 which was called: # once (36µs+128µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 8
use Scalar::Util 'blessed';
# spent 164µs making 1 call to metaclass::BEGIN@8 # spent 128µs making 1 call to Exporter::import
93197µs2378µs
# spent 207µs (37+170) within metaclass::BEGIN@9 which was called: # once (37µs+170µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 9
use Try::Tiny;
# spent 207µs making 1 call to metaclass::BEGIN@9 # spent 170µs making 1 call to Exporter::import
10
1114µsour $VERSION = '1.11';
12164µs$VERSION = eval $VERSION;
# spent 11µs executing statements in string eval
1313µsour $AUTHORITY = 'cpan:STEVAN';
14
153716µs126µs
# spent 26µs within metaclass::BEGIN@15 which was called: # once (26µs+0s) by Moose::Meta::TypeConstraint::BEGIN@6 at line 15
use Class::MOP;
# spent 26µs making 1 call to metaclass::BEGIN@15
16
17
# spent 67.3ms (2.08+65.3) within metaclass::import which was called 20 times, avg 3.37ms/call: # once (193µs+13.7ms) by Moose::Object::BEGIN@14 at line 15 of if.pm # once (108µs+3.77ms) by Moose::Meta::Role::BEGIN@6 at line 6 of Moose/Meta/Role.pm # once (118µs+3.01ms) by Moose::Meta::TypeConstraint::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint.pm # once (101µs+2.91ms) by Moose::Meta::Role::Composite::BEGIN@5 at line 5 of Moose/Meta/Role/Composite.pm # once (97µs+2.89ms) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Parameterized.pm # once (100µs+2.86ms) by Moose::Meta::TypeCoercion::BEGIN@6 at line 6 of Moose/Meta/TypeCoercion.pm # once (97µs+2.63ms) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Parameterizable.pm # once (100µs+2.61ms) by Moose::Meta::Role::Application::ToInstance::BEGIN@5 at line 5 of Moose/Meta/Role/Application/ToInstance.pm # once (100µs+2.60ms) by Moose::Meta::TypeConstraint::Registry::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Registry.pm # once (98µs+2.60ms) by Moose::Meta::Role::Application::ToClass::BEGIN@5 at line 5 of Moose/Meta/Role/Application/ToClass.pm # once (98µs+2.59ms) by Moose::Meta::Role::Application::RoleSummation::BEGIN@5 at line 5 of Moose/Meta/Role/Application/RoleSummation.pm # once (96µs+2.58ms) by Moose::Meta::TypeConstraint::Class::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Class.pm # once (99µs+2.58ms) by Moose::Meta::Role::Application::BEGIN@5 at line 5 of Moose/Meta/Role/Application.pm # once (97µs+2.58ms) by Moose::Meta::TypeConstraint::DuckType::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/DuckType.pm # once (97µs+2.58ms) by Moose::Meta::TypeConstraint::Union::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Union.pm # once (99µs+2.57ms) by Moose::Meta::Role::Application::ToRole::BEGIN@5 at line 5 of Moose/Meta/Role/Application/ToRole.pm # once (99µs+2.57ms) by Moose::Meta::Role::Method::Required::BEGIN@6 at line 6 of Moose/Meta/Role/Method/Required.pm # once (97µs+2.56ms) by Moose::Meta::TypeConstraint::Enum::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Enum.pm # once (93µs+2.55ms) by Moose::Meta::TypeCoercion::Union::BEGIN@6 at line 6 of Moose/Meta/TypeCoercion/Union.pm # once (96µs+2.51ms) by Moose::Meta::TypeConstraint::Role::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Role.pm
sub import {
1820126µs my ( $class, @args ) = @_;
19
202097µs unshift @args, "metaclass" if @args % 2 == 1;
212089µs my %options = @args;
22
232081µs my $meta_name = exists $options{meta_name} ? $options{meta_name} : 'meta';
242064µs my $metaclass = delete $options{metaclass};
25
262074µs unless ( defined $metaclass ) {
27 $metaclass = "Class::MOP::Class";
28 } else {
29112µs10s Class::MOP::load_class($metaclass);
# spent 236µs making 1 call to Class::MOP::load_class, recursion: max depth 1, sum of overlapping time 236µs
30 }
31
3220614µs20241µs ($metaclass->isa('Class::MOP::Class'))
# spent 241µs making 20 calls to UNIVERSAL::isa, avg 12µs/call
33 || confess "The metaclass ($metaclass) must be derived from Class::MOP::Class";
34
35 # make sure the custom metaclasses get loaded
3620222µs foreach my $key (grep { /_(?:meta)?class$/ } keys %options) {
37 unless ( ref( my $class = $options{$key} ) ) {
38 Class::MOP::load_class($class)
39 }
40 }
41
422086µs my $package = caller();
43
44 # create a meta object so we can install &meta
4520277µs2015.1ms my $meta = $metaclass->initialize($package => %options);
# spent 8.73ms making 19 calls to Class::MOP::Class::initialize, avg 459µs/call # spent 6.41ms making 1 call to Moose::Meta::Class::initialize
4620697µs2049.6ms $meta->_add_meta_method($meta_name)
# spent 49.6ms making 20 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.48ms/call
47 if defined $meta_name;
48}
49
50111µs1;
51
52__END__