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

Filename/home/doy/perl5/perlbrew/perls/perl-5.10.1/lib/site_perl/5.10.1/x86_64-linux/metaclass.pm
StatementsExecuted 243 statements in 4.64ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2020202.23ms75.0msmetaclass::::importmetaclass::import
11191µs113µsmetaclass::::BEGIN@4metaclass::BEGIN@4
11172µs366µsmetaclass::::BEGIN@8metaclass::BEGIN@8
11161µs353µsmetaclass::::BEGIN@9metaclass::BEGIN@9
11151µs260µsmetaclass::::BEGIN@7metaclass::BEGIN@7
11151µs138µsmetaclass::::BEGIN@5metaclass::BEGIN@5
11136µs36µ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
43147µs2135µs
# spent 113µs (91+22) within metaclass::BEGIN@4 which was called: # once (91µs+22µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 4
use strict;
# spent 113µs making 1 call to metaclass::BEGIN@4 # spent 22µs making 1 call to strict::import
53158µs2226µs
# spent 138µs (51+88) within metaclass::BEGIN@5 which was called: # once (51µs+88µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 5
use warnings;
# spent 138µs making 1 call to metaclass::BEGIN@5 # spent 88µs making 1 call to warnings::import
6
73161µs2469µs
# spent 260µs (51+209) within metaclass::BEGIN@7 which was called: # once (51µs+209µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 7
use Carp 'confess';
# spent 260µs making 1 call to metaclass::BEGIN@7 # spent 209µs making 1 call to Exporter::import
83165µs2661µs
# spent 366µs (72+295) within metaclass::BEGIN@8 which was called: # once (72µs+295µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 8
use Scalar::Util 'blessed';
# spent 366µs making 1 call to metaclass::BEGIN@8 # spent 295µs making 1 call to Exporter::import
93312µs2645µs
# spent 353µs (61+292) within metaclass::BEGIN@9 which was called: # once (61µs+292µs) by Moose::Meta::TypeConstraint::BEGIN@6 at line 9
use Try::Tiny;
# spent 353µs making 1 call to metaclass::BEGIN@9 # spent 292µs making 1 call to Exporter::import
10
1116µsour $VERSION = '1.11';
12196µs$VERSION = eval $VERSION;
# spent 14µs executing statements in string eval
1314µsour $AUTHORITY = 'cpan:STEVAN';
14
1531.01ms136µs
# spent 36µs within metaclass::BEGIN@15 which was called: # once (36µs+0s) by Moose::Meta::TypeConstraint::BEGIN@6 at line 15
use Class::MOP;
# spent 36µs making 1 call to metaclass::BEGIN@15
16
17
# spent 75.0ms (2.23+72.8) within metaclass::import which was called 20 times, avg 3.75ms/call: # once (188µs+14.5ms) by Moose::Object::BEGIN@14 at line 15 of if.pm # once (160µs+4.87ms) by Moose::Meta::TypeConstraint::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint.pm # once (142µs+3.31ms) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Parameterized.pm # once (99µs+3.26ms) by Moose::Meta::TypeCoercion::BEGIN@6 at line 6 of Moose/Meta/TypeCoercion.pm # once (101µs+3.20ms) by Moose::Meta::Role::Composite::BEGIN@5 at line 5 of Moose/Meta/Role/Composite.pm # once (111µs+3.02ms) by Moose::Meta::Role::Application::RoleSummation::BEGIN@5 at line 5 of Moose/Meta/Role/Application/RoleSummation.pm # once (111µs+3.00ms) by Moose::Meta::Role::Application::ToRole::BEGIN@5 at line 5 of Moose/Meta/Role/Application/ToRole.pm # once (98µs+2.96ms) by Moose::Meta::Role::Application::BEGIN@5 at line 5 of Moose/Meta/Role/Application.pm # once (98µs+2.94ms) by Moose::Meta::Role::Application::ToInstance::BEGIN@5 at line 5 of Moose/Meta/Role/Application/ToInstance.pm # once (95µs+2.93ms) by Moose::Meta::TypeConstraint::Enum::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Enum.pm # once (131µs+2.89ms) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Parameterizable.pm # once (102µs+2.91ms) by Moose::Meta::Role::Method::Required::BEGIN@6 at line 6 of Moose/Meta/Role/Method/Required.pm # once (98µs+2.91ms) by Moose::Meta::Role::Application::ToClass::BEGIN@5 at line 5 of Moose/Meta/Role/Application/ToClass.pm # once (97µs+2.90ms) by Moose::Meta::TypeConstraint::Union::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Union.pm # once (98µs+2.89ms) by Moose::Meta::TypeConstraint::Registry::BEGIN@6 at line 6 of Moose/Meta/TypeConstraint/Registry.pm # once (97µs+2.89ms) by Moose::Meta::TypeConstraint::DuckType::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/DuckType.pm # once (95µs+2.88ms) by Moose::Meta::TypeCoercion::Union::BEGIN@6 at line 6 of Moose/Meta/TypeCoercion/Union.pm # once (109µs+2.86ms) by Moose::Meta::Role::BEGIN@6 at line 6 of Moose/Meta/Role.pm # once (96µs+2.87ms) by Moose::Meta::TypeConstraint::Class::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Class.pm # once (100µs+2.86ms) by Moose::Meta::TypeConstraint::Role::BEGIN@5 at line 5 of Moose/Meta/TypeConstraint/Role.pm
sub import {
182202.56ms my ( $class, @args ) = @_;
19
20 unshift @args, "metaclass" if @args % 2 == 1;
21 my %options = @args;
22
23 my $meta_name = exists $options{meta_name} ? $options{meta_name} : 'meta';
24 my $metaclass = delete $options{metaclass};
25
26112µs unless ( defined $metaclass ) {
27 $metaclass = "Class::MOP::Class";
28 } else {
2910s Class::MOP::load_class($metaclass);
# spent 240µs making 1 call to Class::MOP::load_class, recursion: max depth 1, sum of overlapping time 240µs
30 }
31
3220250µs ($metaclass->isa('Class::MOP::Class'))
# spent 250µs making 20 calls to UNIVERSAL::isa, avg 13µs/call
33 || confess "The metaclass ($metaclass) must be derived from Class::MOP::Class";
34
35 # make sure the custom metaclasses get loaded
36 foreach my $key (grep { /_(?:meta)?class$/ } keys %options) {
37 unless ( ref( my $class = $options{$key} ) ) {
38 Class::MOP::load_class($class)
39 }
40 }
41
42 my $package = caller();
43
44 # create a meta object so we can install &meta
452018.8ms my $meta = $metaclass->initialize($package => %options);
# spent 12.2ms making 19 calls to Class::MOP::Class::initialize, avg 643µs/call # spent 6.63ms making 1 call to Moose::Meta::Class::initialize
462053.5ms $meta->_add_meta_method($meta_name)
# spent 53.5ms making 20 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 2.67ms/call
47 if defined $meta_name;
48}
49
50115µs1;
51
52__END__