← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:23:32 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/x86_64-linux/metaclass.pm
StatementsExecuted 246 statements in 931µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
202020481µs13.4msmetaclass::::importmetaclass::import
1118µs52µsmetaclass::::BEGIN@13metaclass::BEGIN@13
1118µs8µsmetaclass::::BEGIN@3metaclass::BEGIN@3
1118µs28µsmetaclass::::BEGIN@14metaclass::BEGIN@14
1117µs30µsmetaclass::::BEGIN@15metaclass::BEGIN@15
1117µs35µsmetaclass::::BEGIN@16metaclass::BEGIN@16
1117µs9µsmetaclass::::BEGIN@10metaclass::BEGIN@10
1116µs13µsmetaclass::::BEGIN@11metaclass::BEGIN@11
1115µs5µ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 8µs within metaclass::BEGIN@3 which was called: # once (8µs+0s) by Moose::Meta::TypeConstraint::BEGIN@12 at line 5
BEGIN {
414µs $metaclass::AUTHORITY = 'cpan:STEVAN';
5120µs18µs}
# spent 8µs making 1 call to metaclass::BEGIN@3
6{
721µs $metaclass::VERSION = '2.0602';
8}
9
10315µs211µs
# spent 9µs (7+2) within metaclass::BEGIN@10 which was called: # once (7µs+2µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 10
use strict;
# spent 9µs making 1 call to metaclass::BEGIN@10 # spent 2µs making 1 call to strict::import
11317µs220µs
# spent 13µs (6+7) within metaclass::BEGIN@11 which was called: # once (6µs+7µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 11
use warnings;
# spent 13µs making 1 call to metaclass::BEGIN@11 # spent 7µs making 1 call to warnings::import
12
13322µs295µs
# spent 52µs (8+43) within metaclass::BEGIN@13 which was called: # once (8µs+43µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 13
use Carp 'confess';
# spent 52µs making 1 call to metaclass::BEGIN@13 # spent 43µs making 1 call to Exporter::import
14318µs248µs
# spent 28µs (8+20) within metaclass::BEGIN@14 which was called: # once (8µs+20µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 14
use Class::Load 'load_class';
# spent 28µs making 1 call to metaclass::BEGIN@14 # spent 20µs making 1 call to Exporter::import
15317µs253µs
# spent 30µs (7+23) within metaclass::BEGIN@15 which was called: # once (7µs+23µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 15
use Scalar::Util 'blessed';
# spent 30µs making 1 call to metaclass::BEGIN@15 # spent 23µs making 1 call to Exporter::import
16317µs264µs
# spent 35µs (7+28) within metaclass::BEGIN@16 which was called: # once (7µs+28µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 16
use Try::Tiny;
# spent 35µs making 1 call to metaclass::BEGIN@16 # spent 28µs making 1 call to Exporter::import
17
183258µs15µs
# spent 5µs within metaclass::BEGIN@18 which was called: # once (5µs+0s) by Moose::Meta::TypeConstraint::BEGIN@12 at line 18
use Class::MOP;
# spent 5µs making 1 call to metaclass::BEGIN@18
19
20
# spent 13.4ms (481µs+12.9) within metaclass::import which was called 20 times, avg 670µs/call: # once (45µs+2.39ms) by Moose::Object::BEGIN@20 at line 15 of if.pm # once (22µs+659µs) by Moose::Meta::TypeConstraint::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint.pm # once (23µs+655µs) by Moose::Meta::TypeCoercion::BEGIN@12 at line 12 of Moose/Meta/TypeCoercion.pm # once (26µs+647µs) by Moose::Meta::Role::Composite::BEGIN@11 at line 11 of Moose/Meta/Role/Composite.pm # once (26µs+598µs) by Moose::Meta::TypeConstraint::Union::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint/Union.pm # once (24µs+594µs) by Moose::Meta::Role::Application::BEGIN@11 at line 11 of Moose/Meta/Role/Application.pm # once (23µs+569µs) by Moose::Meta::TypeConstraint::Class::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Class.pm # once (25µs+561µs) by Moose::Meta::Role::Method::Required::BEGIN@12 at line 12 of Moose/Meta/Role/Method/Required.pm # once (26µs+556µs) by Moose::Meta::Role::BEGIN@11 at line 11 of Moose/Meta/Role.pm # once (25µs+546µs) by Moose::Meta::Role::Application::ToRole::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToRole.pm # once (24µs+545µs) by Moose::Meta::Role::Application::ToClass::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToClass.pm # once (23µs+540µs) by Moose::Meta::TypeConstraint::Parameterized::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Parameterized.pm # once (24µs+539µs) by Moose::Meta::TypeConstraint::Registry::BEGIN@12 at line 12 of Moose/Meta/TypeConstraint/Registry.pm # once (23µs+538µs) by Moose::Meta::Role::Application::RoleSummation::BEGIN@11 at line 11 of Moose/Meta/Role/Application/RoleSummation.pm # once (22µs+536µs) by Moose::Meta::Role::Application::ToInstance::BEGIN@11 at line 11 of Moose/Meta/Role/Application/ToInstance.pm # once (23µs+529µs) by Moose::Meta::TypeConstraint::Enum::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Enum.pm # once (23µs+527µs) by Moose::Meta::TypeConstraint::DuckType::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/DuckType.pm # once (23µs+524µs) by Moose::Meta::TypeConstraint::Role::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Role.pm # once (16µs+438µs) by Moose::Meta::TypeConstraint::Parameterizable::BEGIN@11 at line 11 of Moose/Meta/TypeConstraint/Parameterizable.pm # once (16µs+431µs) by Moose::Meta::TypeCoercion::Union::BEGIN@12 at line 12 of Moose/Meta/TypeCoercion/Union.pm
sub import {
212033µs my ( $class, @args ) = @_;
22
232027µs unshift @args, "metaclass" if @args % 2 == 1;
242018µs my %options = @args;
25
262017µs my $meta_name = exists $options{meta_name} ? $options{meta_name} : 'meta';
272025µs my $metaclass = delete $options{metaclass};
28
292017µs unless ( defined $metaclass ) {
30 $metaclass = "Class::MOP::Class";
31 } else {
3212µs138µs load_class($metaclass);
# spent 38µs making 1 call to Class::Load::load_class
33 }
34
3520130µs2043µs ($metaclass->isa('Class::MOP::Class'))
# spent 43µ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
392041µs foreach my $key (grep { /_(?:meta)?class$/ } keys %options) {
40 unless ( ref( my $class = $options{$key} ) ) {
41 load_class($class)
42 }
43 }
44
452026µs my $package = caller();
46
47 # create a meta object so we can install &meta
482051µs203.20ms my $meta = $metaclass->initialize($package => %options);
# spent 2.15ms making 19 calls to Class::MOP::Class::initialize, avg 113µs/call # spent 1.05ms making 1 call to Moose::Meta::Class::initialize
4920153µs209.63ms $meta->_add_meta_method($meta_name)
# spent 9.63ms making 20 calls to Class::MOP::Mixin::HasMethods::_add_meta_method, avg 482µs/call
50 if defined $meta_name;
51}
52
5313µs1;
54
55# ABSTRACT: a pragma for installing and using Class::MOP metaclasses
56
- -
59=pod
60
61=head1 NAME
62
63metaclass - a pragma for installing and using Class::MOP metaclasses
64
65=head1 VERSION
66
67version 2.0602
68
69=head1 SYNOPSIS
70
71 package MyClass;
72
73 # use Class::MOP::Class
74 use metaclass;
75
76 # ... or use a custom metaclass
77 use metaclass 'MyMetaClass';
78
79 # ... or use a custom metaclass
80 # and custom attribute and method
81 # metaclasses
82 use metaclass 'MyMetaClass' => (
83 'attribute_metaclass' => 'MyAttributeMetaClass',
84 'method_metaclass' => 'MyMethodMetaClass',
85 );
86
87 # ... or just specify custom attribute
88 # and method classes, and Class::MOP::Class
89 # is the assumed metaclass
90 use metaclass (
91 'attribute_metaclass' => 'MyAttributeMetaClass',
92 'method_metaclass' => 'MyMethodMetaClass',
93 );
94
95 # if we'd rather not install a 'meta' method, we can do this
96 use metaclass meta_name => undef;
97 # or if we'd like it to have a different name,
98 use metaclass meta_name => 'my_meta';
99
100=head1 DESCRIPTION
101
102This is a pragma to make it easier to use a specific metaclass
103and a set of custom attribute and method metaclasses. It also
104installs a C<meta> method to your class as well, unless C<undef>
105is passed to the C<meta_name> option.
106
107Note that if you are using Moose, you most likely do B<not> want
108to be using this - look into L<Moose::Util::MetaRole> instead.
109
110=head1 AUTHOR
111
112Moose is maintained by the Moose Cabal, along with the help of many contributors. See L<Moose/CABAL> and L<Moose/CONTRIBUTORS> for details.
113
114=head1 COPYRIGHT AND LICENSE
115
116This software is copyright (c) 2012 by Infinity Interactive, Inc..
117
118This is free software; you can redistribute it and/or modify it under
119the same terms as the Perl 5 programming language system itself.
120
121=cut
122
123
124__END__