← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 09:58:41 2014
Reported on Tue Jun 24 09:59:22 2014

Filename/usr/local/lib/perl/5.14.2/metaclass.pm
StatementsExecuted 258 statements in 744µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
202020320µs9.88msmetaclass::::importmetaclass::import
1117µs10µsmetaclass::::BEGIN@10metaclass::BEGIN@10
1117µs7µsmetaclass::::BEGIN@3metaclass::BEGIN@3
1117µs35µsmetaclass::::BEGIN@16metaclass::BEGIN@16
1116µs28µsmetaclass::::BEGIN@15metaclass::BEGIN@15
1116µs27µsmetaclass::::BEGIN@14metaclass::BEGIN@14
1116µs10µsmetaclass::::BEGIN@11metaclass::BEGIN@11
1116µs32µsmetaclass::::BEGIN@13metaclass::BEGIN@13
1114µs4µ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 {
415µs $metaclass::AUTHORITY = 'cpan:STEVAN';
5127µs17µs}
# spent 7µs making 1 call to metaclass::BEGIN@3
6{
721µs $metaclass::VERSION = '2.1005';
8}
9
10220µs213µs
# spent 10µs (7+3) within metaclass::BEGIN@10 which was called: # once (7µs+3µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 10
use strict;
# spent 10µs making 1 call to metaclass::BEGIN@10 # spent 3µs making 1 call to strict::import
11221µs215µs
# spent 10µs (6+5) within metaclass::BEGIN@11 which was called: # once (6µs+5µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 11
use warnings;
# spent 10µs making 1 call to metaclass::BEGIN@11 # spent 5µs making 1 call to warnings::import
12
13224µs258µs
# spent 32µs (6+26) within metaclass::BEGIN@13 which was called: # once (6µs+26µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 13
use Carp 'confess';
# spent 32µs making 1 call to metaclass::BEGIN@13 # spent 26µs making 1 call to Exporter::import
14222µs248µs
# spent 27µs (6+21) within metaclass::BEGIN@14 which was called: # once (6µs+21µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 14
use Class::Load 'load_class';
# spent 27µs making 1 call to metaclass::BEGIN@14 # spent 21µs making 1 call to Exporter::import
15221µs250µs
# spent 28µs (6+22) within metaclass::BEGIN@15 which was called: # once (6µs+22µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 15
use Scalar::Util 'blessed';
# spent 28µs making 1 call to metaclass::BEGIN@15 # spent 22µs making 1 call to Exporter::import
16222µs264µs
# spent 35µs (7+29) within metaclass::BEGIN@16 which was called: # once (7µs+29µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 16
use Try::Tiny;
# spent 35µs making 1 call to metaclass::BEGIN@16 # spent 29µs making 1 call to Exporter::import
17
182187µs14µs
# spent 4µs within metaclass::BEGIN@18 which was called: # once (4µs+0s) by Moose::Meta::TypeConstraint::BEGIN@12 at line 18
use Class::MOP;
# spent 4µs making 1 call to metaclass::BEGIN@18
19
20
# spent 9.88ms (320µs+9.56) within metaclass::import which was called 20 times, avg 494µs/call: # once (29µs+1.92ms) by Moose::Object::BEGIN@20 at line 15 of if.pm # once (14µs+489µs) by Moose::Meta::Role::Composite::BEGIN@11 at line 11 of Moose/Meta/Role/Composite.pm # once (20µs+452µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint.pm # once (15µs+445µs) by Moose::Meta::TypeCoercion::BEGIN@12 at line 12 of Moose/Meta/TypeCoercion.pm # once (15µs+412µs) by Moose::Meta::Role::BEGIN@11 at line 11 of Moose/Meta/Role.pm # once (28µs+394µs) by Moose::Meta::Role::Application::ToInstance::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToInstance.pm # once (14µs+395µs) by Moose::Meta::Role::Application::ToRole::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToRole.pm # once (15µs+394µs) by Moose::Meta::Role::Method::Required::BEGIN@12 at line 12 of Moose/Meta/Role/Method/Required.pm # once (15µs+393µs) by Moose::Meta::TypeConstraint::Union::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint/Union.pm # once (15µs+393µs) by Moose::Meta::Role::Application::ToClass::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToClass.pm # once (14µs+391µs) by Moose::Meta::Role::Application::RoleSummation::BEGIN@11 at line 11 of Moose/Meta/Role/Application/RoleSummation.pm # once (14µs+391µs) by Moose::Meta::TypeCoercion::Union::BEGIN@12 at line 12 of Moose/Meta/TypeCoercion/Union.pm # once (14µs+389µs) by Moose::Meta::TypeConstraint::Enum::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Enum.pm # once (14µs+388µs) by Moose::Meta::TypeConstraint::Class::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Class.pm # once (15µs+387µs) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Parameterized.pm # once (14µs+387µs) by Moose::Meta::TypeConstraint::Registry::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint/Registry.pm # once (14µs+387µs) by Moose::Meta::Role::Application::BEGIN@11 at line 11 of Moose/Meta/Role/Application.pm # once (14µs+386µs) by Moose::Meta::TypeConstraint::DuckType::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/DuckType.pm # once (14µs+382µs) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Parameterizable.pm # once (14µs+380µs) by Moose::Meta::TypeConstraint::Role::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Role.pm
sub import {
21220383µs my ( $class, @args ) = @_;
22
23 unshift @args, "metaclass" if @args % 2 == 1;
24 my %options = @args;
25
26 my $meta_name = exists $options{meta_name} ? $options{meta_name} : 'meta';
27 my $metaclass = delete $options{metaclass};
28
29209µs unless ( defined $metaclass ) {
30 $metaclass = "Class::MOP::Class";
31 } else {
32126µs load_class($metaclass);
# spent 26µs making 1 call to Class::Load::load_class
33 }
34
352038µs ($metaclass->isa('Class::MOP::Class'))
# spent 38µs making 20 calls to UNIVERSAL::isa, avg 2µs/call
36 || confess "The metaclass ($metaclass) must be derived from Class::MOP::Class";
37
38 # make sure the custom metaclasses get loaded
39 foreach my $key (grep { /_(?:meta)?class$/ } keys %options) {
40 unless ( ref( my $class = $options{$key} ) ) {
41 load_class($class)
42 }
43 }
44
45 my $package = caller();
46
47 # create a meta object so we can install &meta
48202.19ms my $meta = $metaclass->initialize($package => %options);
# spent 1.33ms making 19 calls to Class::MOP::Class::initialize, avg 70µs/call # spent 861µs making 1 call to Moose::Meta::Class::initialize
49207.30ms $meta->_add_meta_method($meta_name)
# spent 7.30ms making 20 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 365µs/call
50 if defined $meta_name;
51}
52
5312µs1;
54
55# ABSTRACT: a pragma for installing and using Class::MOP metaclasses
56
57__END__