← Index
Performance Profile   « block view • line view • sub view »
For t/test-parsing
  Run on Sun Nov 14 09:49:57 2010
Reported on Sun Nov 14 09:50:11 2010

File /home/tamil/util/marc-moose/lib/MARC/Moose/Field/Std.pm
Statements Executed 17
Total Time 0.0005072 seconds
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sMARC::Moose::Field::Std::::BEGINMARC::Moose::Field::Std::BEGIN
0000s0sMARC::Moose::Field::Std::::__ANON__[:16]MARC::Moose::Field::Std::__ANON__[:16]
0000s0sMARC::Moose::Field::Std::::__ANON__[:25]MARC::Moose::Field::Std::__ANON__[:25]
0000s0sMARC::Moose::Field::Std::::subfieldMARC::Moose::Field::Std::subfield
LineStmts.Exclusive
Time
Avg.Code
1package MARC::Moose::Field::Std;
2# ABSTRACT: Standard Marc Field (tag >= 010)
3
4329µs10µsuse namespace::autoclean;
# spent 67µs making 1 call to namespace::autoclean::import
5367µs22µsuse Moose;
6
719µs9µsextends 'MARC::Moose::Field';
# spent 1.39ms making 1 call to Moose::extends
8
9use overload
103294µs98µs '%{}' => \&subfield;
# spent 53µs making 1 call to overload::import
11
12
1316µs6µshas ind1 => (is => 'rw', isa => 'Str', default => ' ');
# spent 2.69ms making 1 call to Moose::has
1416µs6µshas ind2 => (is => 'rw', isa => 'Str', default => ' ');
# spent 2.39ms making 1 call to Moose::has
15
16110µs10µshas subf => ( is => 'rw', isa => 'ArrayRef', default => sub { [] } );
# spent 2.34ms making 1 call to Moose::has
17
18
19override 'as_formatted' => sub {
20 my $self = shift;
21
22 join ' ', (
23 $self->tag,
24 map { ("\$$_->[0]", $_->[1]) } @{$self->subf} );
25112µs12µs};
# spent 659µs making 1 call to Moose::override
26
27
28sub subfield {
29 my ($self, $letter) = @_;
30
31 my @values;
32 for ( @{$self->subf} ) {
33 push @values, $_->[1] if $_->[0] eq $letter;
34 }
35
36 return wantarray ? @values : $values[0];
37}
38
39114µs14µs__PACKAGE__->meta->make_immutable;
# spent 6.67ms making 1 call to Class::MOP::Class::make_immutable # spent 20µs making 1 call to MARC::Moose::Field::Std::meta
40
41142µs42µs1;
42119µs19µs