← 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/metaclass.pm
StatementsExecuted 239 statements in 612µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
202020250µs14.0msmetaclass::::importmetaclass::import
1117µs7µsmetaclass::::BEGIN@3metaclass::BEGIN@3
1116µs36µsmetaclass::::BEGIN@13metaclass::BEGIN@13
1116µs29µsmetaclass::::BEGIN@16metaclass::BEGIN@16
1116µs23µsmetaclass::::BEGIN@14metaclass::BEGIN@14
1116µs23µsmetaclass::::BEGIN@15metaclass::BEGIN@15
1116µs15µsmetaclass::::BEGIN@10metaclass::BEGIN@10
1116µs8µsmetaclass::::BEGIN@11metaclass::BEGIN@11
1113µs3µsmetaclass::::BEGIN@18metaclass::BEGIN@18
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
# spent 7µs within metaclass::BEGIN@3 which was called: # once (7µs+0s) by Moose::Meta::TypeConstraint::BEGIN@12 at line 5
BEGIN {
414µs $metaclass::AUTHORITY = 'cpan:STEVAN';
5128µs17µs}
# spent 7µs making 1 call to metaclass::BEGIN@3
6{
72900ns $metaclass::VERSION = '2.1005';
8}
9
10219µs224µs
# spent 15µs (6+10) within metaclass::BEGIN@10 which was called: # once (6µs+10µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 10
use strict;
# spent 15µs making 1 call to metaclass::BEGIN@10 # spent 10µs making 1 call to strict::import
11220µs211µs
# spent 8µs (6+3) within metaclass::BEGIN@11 which was called: # once (6µs+3µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 11
use warnings;
# spent 8µs making 1 call to metaclass::BEGIN@11 # spent 3µs making 1 call to warnings::import
12
13225µs266µs
# spent 36µs (6+30) within metaclass::BEGIN@13 which was called: # once (6µs+30µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 13
use Carp 'confess';
# spent 36µs making 1 call to metaclass::BEGIN@13 # spent 30µs making 1 call to Exporter::import
14222µs241µs
# spent 23µs (6+18) within metaclass::BEGIN@14 which was called: # once (6µs+18µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 14
use Class::Load 'load_class';
# spent 23µs making 1 call to metaclass::BEGIN@14 # spent 18µs making 1 call to Exporter::import
15228µs240µs
# spent 23µs (6+17) within metaclass::BEGIN@15 which was called: # once (6µs+17µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 15
use Scalar::Util 'blessed';
# spent 23µs making 1 call to metaclass::BEGIN@15 # spent 17µs making 1 call to Exporter::import
16218µs252µs
# spent 29µs (6+23) within metaclass::BEGIN@16 which was called: # once (6µs+23µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 16
use Try::Tiny;
# spent 29µs making 1 call to metaclass::BEGIN@16 # spent 23µs making 1 call to Exporter::import
17
182182µs13µs
# spent 3µs within metaclass::BEGIN@18 which was called: # once (3µs+0s) by Moose::Meta::TypeConstraint::BEGIN@12 at line 18
use Class::MOP;
# spent 3µs making 1 call to metaclass::BEGIN@18
19
20
# spent 14.0ms (250µs+13.8) within metaclass::import which was called 20 times, avg 700µs/call: # once (11µs+3.70ms) by Moose::Meta::TypeConstraint::DuckType::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/DuckType.pm # once (12µs+2.94ms) by Moose::Meta::Role::Application::ToClass::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToClass.pm # once (28µs+1.60ms) by Moose::Object::BEGIN@20 at line 15 of if.pm # once (16µs+419µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint.pm # once (12µs+371µs) by Moose::Meta::TypeConstraint::Enum::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Enum.pm # once (12µs+328µs) by Moose::Meta::Role::BEGIN@11 at line 11 of Moose/Meta/Role.pm # once (11µs+319µs) by Moose::Meta::TypeConstraint::Union::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint/Union.pm # once (12µs+318µs) by Moose::Meta::Role::Application::ToInstance::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToInstance.pm # once (11µs+318µs) by Moose::Meta::TypeCoercion::Union::BEGIN@12 at line 12 of Moose/Meta/TypeCoercion/Union.pm # once (11µs+316µs) by Moose::Meta::TypeConstraint::Registry::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint/Registry.pm # once (11µs+316µs) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Parameterizable.pm # once (11µs+315µs) by Moose::Meta::TypeConstraint::Role::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Role.pm # once (11µs+315µs) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Parameterized.pm # once (11µs+314µs) by Moose::Meta::Role::Application::ToRole::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToRole.pm # once (11µs+315µs) by Moose::Meta::TypeCoercion::BEGIN@12 at line 12 of Moose/Meta/TypeCoercion.pm # once (11µs+314µs) by Moose::Meta::Role::Method::Required::BEGIN@12 at line 12 of Moose/Meta/Role/Method/Required.pm # once (11µs+313µs) by Moose::Meta::Role::Application::BEGIN@11 at line 11 of Moose/Meta/Role/Application.pm # once (12µs+310µs) by Moose::Meta::Role::Composite::BEGIN@11 at line 11 of Moose/Meta/Role/Composite.pm # once (11µs+310µs) by Moose::Meta::Role::Application::RoleSummation::BEGIN@11 at line 11 of Moose/Meta/Role/Application/RoleSummation.pm # once (11µs+309µs) by Moose::Meta::TypeConstraint::Class::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Class.pm
sub import {
212011µs my ( $class, @args ) = @_;
22
232011µs unshift @args, "metaclass" if @args % 2 == 1;
24208µs my %options = @args;
25
26208µs my $meta_name = exists $options{meta_name} ? $options{meta_name} : 'meta';
27206µs my $metaclass = delete $options{metaclass};
28
29206µs unless ( defined $metaclass ) {
30 $metaclass = "Class::MOP::Class";
31 } else {
3211µs121µs load_class($metaclass);
# spent 21µs making 1 call to Class::Load::load_class
33 }
34
352073µs2025µs ($metaclass->isa('Class::MOP::Class'))
# spent 25µs making 20 calls to UNIVERSAL::isa, avg 1µs/call
36 || confess "The metaclass ($metaclass) must be derived from Class::MOP::Class";
37
38 # make sure the custom metaclasses get loaded
392022µs foreach my $key (grep { /_(?:meta)?class$/ } keys %options) {
40 unless ( ref( my $class = $options{$key} ) ) {
41 load_class($class)
42 }
43 }
44
45208µs my $package = caller();
46
47 # create a meta object so we can install &meta
482024µs205.16ms my $meta = $metaclass->initialize($package => %options);
# spent 4.43ms making 19 calls to Class::MOP::Class::initialize, avg 233µs/call # spent 721µs making 1 call to Moose::Meta::Class::initialize
492084µs208.56ms $meta->_add_meta_method($meta_name)
# spent 8.56ms making 20 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 428µs/call
50 if defined $meta_name;
51}
52
5313µs1;
54
55# ABSTRACT: a pragma for installing and using Class::MOP metaclasses
56
57__END__