← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:22:38 2010

File /usr/local/lib/perl5/site_perl/5.10.1/MooseX/AttributeHelpers/Trait/Collection/Bag.pm
Statements Executed 23
Statement Execution Time 408µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111303µs5.27msMooseX::AttributeHelpers::Trait::Collection::Bag::::BEGIN@10MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@10
11114µs1.49msMooseX::AttributeHelpers::Trait::Collection::Bag::::BEGIN@3MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@3
1119µs1.19msMooseX::AttributeHelpers::Trait::Collection::Bag::::BEGIN@4MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@4
1118µs102µsMooseX::AttributeHelpers::Trait::Collection::Bag::::BEGIN@37MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@37
1118µs113µsMooseX::AttributeHelpers::Trait::Collection::Bag::::BEGIN@36MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@36
0000s0sMooseX::AttributeHelpers::Trait::Collection::Bag::::__ANON__[:33]MooseX::AttributeHelpers::Trait::Collection::Bag::__ANON__[:33]
0000s0sMooseX::AttributeHelpers::Trait::Collection::Bag::::__ANON__[:34]MooseX::AttributeHelpers::Trait::Collection::Bag::__ANON__[:34]
0000s0sMooseX::AttributeHelpers::Trait::Collection::Bag::::helper_typeMooseX::AttributeHelpers::Trait::Collection::Bag::helper_type
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
2package MooseX::AttributeHelpers::Trait::Collection::Bag;
3327µs22.96ms
# spent 1.49ms (14µs+1.47) within MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@3 which was called # once (14µs+1.47ms) by MooseX::AttributeHelpers::BEGIN@21 at line 3
use Moose::Role;
4354µs22.37ms
# spent 1.19ms (9µs+1.18) within MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@4 which was called # once (9µs+1.18ms) by MooseX::AttributeHelpers::BEGIN@21 at line 4
use Moose::Util::TypeConstraints;
5
61700nsour $VERSION = '0.23';
7114µs$VERSION = eval $VERSION;
81300nsour $AUTHORITY = 'cpan:STEVAN';
9
103216µs15.27ms
# spent 5.27ms (303µs+4.97) within MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@10 which was called # once (303µs+4.97ms) by MooseX::AttributeHelpers::BEGIN@21 at line 10
use MooseX::AttributeHelpers::MethodProvider::Bag;
11
1213µs12.04mswith 'MooseX::AttributeHelpers::Trait::Collection';
# spent 2.04ms making 1 call to Moose::Role::with
13
1412µs192µshas 'method_provider' => (
# spent 92µs making 1 call to Moose::Role::has
15 is => 'ro',
16 isa => 'ClassName',
17 predicate => 'has_method_provider',
18 default => 'MooseX::AttributeHelpers::MethodProvider::Bag'
19);
20
2115µs21.78mssubtype 'Bag' => as 'HashRef[Int]';
# spent 1.78ms making 1 call to Moose::Util::TypeConstraints::subtype # spent 3µs making 1 call to Moose::Util::TypeConstraints::as
22
23sub helper_type { 'Bag' }
24
25before 'process_options_for_provides' => sub {
26 my ($self, $options, $name) = @_;
27
28 # Set some default attribute options here unless already defined
29 if ((my $type = $self->helper_type) && !exists $options->{isa}){
30 $options->{isa} = $type;
31 }
32
33 $options->{default} = sub { +{} } unless exists $options->{default};
3413µs148µs};
# spent 48µs making 1 call to Moose::Role::before
35
36325µs2219µs
# spent 113µs (8+106) within MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@36 which was called # once (8µs+106µs) by MooseX::AttributeHelpers::BEGIN@21 at line 36
no Moose::Role;
37334µs2197µs
# spent 102µs (8+95) within MooseX::AttributeHelpers::Trait::Collection::Bag::BEGIN@37 which was called # once (8µs+95µs) by MooseX::AttributeHelpers::BEGIN@21 at line 37
no Moose::Util::TypeConstraints;
38
39124µs1;
40
41__END__
42
43=pod
44
45=head1 NAME
46
47MooseX::AttributeHelpers::Collection::Bag
48
49=head1 SYNOPSIS
50
51 package Stuff;
52 use Moose;
53 use MooseX::AttributeHelpers;
54
55 has 'word_histogram' => (
56 metaclass => 'Collection::Bag',
57 is => 'ro',
58 isa => 'Bag', # optional ... as is defalt
59 provides => {
60 'add' => 'add_word',
61 'get' => 'get_count_for',
62 'empty' => 'has_any_words',
63 'count' => 'num_words',
64 'delete' => 'delete_word',
65 }
66 );
67
68=head1 DESCRIPTION
69
70This module provides a Bag attribute which provides a number of
71bag-like operations. See L<MooseX::AttributeHelpers::MethodProvider::Bag>
72for more details.
73
74=head1 METHODS
75
76=over 4
77
78=item B<meta>
79
80=item B<method_provider>
81
82=item B<has_method_provider>
83
84=item B<helper_type>
85
86=item B<process_options_for_provides>
87
88=back
89
90=head1 BUGS
91
92All complex software has bugs lurking in it, and this module is no
93exception. If you find a bug please either email me, or add the bug
94to cpan-RT.
95
96=head1 AUTHOR
97
98Stevan Little E<lt>stevan@iinteractive.comE<gt>
99
100=head1 COPYRIGHT AND LICENSE
101
102Copyright 2007-2009 by Infinity Interactive, Inc.
103
104L<http://www.iinteractive.com>
105
106This library is free software; you can redistribute it and/or modify
107it under the same terms as Perl itself.
108
109=cut