Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/MouseX/Getopt/GLD.pm |
Statements | Executed 113 statements in 849µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 1.98ms | 35.7ms | BEGIN@12 | MouseX::Getopt::GLD::
1 | 1 | 1 | 218µs | 255µs | _gld_spec | MouseX::Getopt::GLD::
22 | 1 | 1 | 36µs | 36µs | CORE:subst (opcode) | MouseX::Getopt::GLD::
1 | 1 | 1 | 20µs | 48.2ms | __ANON__[:39] | MouseX::Getopt::GLD::
1 | 1 | 1 | 19µs | 19µs | BEGIN@2 | MouseX::Getopt::GLD::
1 | 1 | 1 | 13µs | 109µs | BEGIN@73 | MouseX::Getopt::GLD::
1 | 1 | 1 | 11µs | 266µs | __ANON__[:33] | MouseX::Getopt::GLD::
1 | 1 | 1 | 10µs | 278µs | BEGIN@10 | MouseX::Getopt::GLD::
1 | 1 | 1 | 5µs | 5µs | BEGIN@5 | MouseX::Getopt::GLD::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package MouseX::Getopt::GLD; | ||||
2 | # spent 19µs within MouseX::Getopt::GLD::BEGIN@2 which was called:
# once (19µs+0s) by Mouse::Util::_try_load_one_class at line 4 | ||||
3 | 1 | 6µs | $MouseX::Getopt::GLD::AUTHORITY = 'cpan:STEVAN'; | ||
4 | 1 | 22µs | 1 | 19µs | } # spent 19µs making 1 call to MouseX::Getopt::GLD::BEGIN@2 |
5 | # spent 5µs within MouseX::Getopt::GLD::BEGIN@5 which was called:
# once (5µs+0s) by Mouse::Util::_try_load_one_class at line 7 | ||||
6 | 1 | 5µs | $MouseX::Getopt::GLD::VERSION = '0.33'; | ||
7 | 1 | 18µs | 1 | 5µs | } # spent 5µs making 1 call to MouseX::Getopt::GLD::BEGIN@5 |
8 | # ABSTRACT: A Mouse role for processing command line options with Getopt::Long::Descriptive | ||||
9 | |||||
10 | 2 | 70µs | 2 | 545µs | # spent 278µs (10+267) within MouseX::Getopt::GLD::BEGIN@10 which was called:
# once (10µs+267µs) by Mouse::Util::_try_load_one_class at line 10 # spent 278µs making 1 call to MouseX::Getopt::GLD::BEGIN@10
# spent 267µs making 1 call to Mouse::Exporter::do_import |
11 | |||||
12 | 3 | 372µs | 3 | 36.1ms | # spent 35.7ms (1.98+33.7) within MouseX::Getopt::GLD::BEGIN@12 which was called:
# once (1.98ms+33.7ms) by Mouse::Util::_try_load_one_class at line 12 # spent 35.7ms making 1 call to MouseX::Getopt::GLD::BEGIN@12
# spent 365µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
# spent 13µs making 1 call to UNIVERSAL::VERSION |
13 | |||||
14 | 1 | 5µs | 1 | 0s | with 'MouseX::Getopt::Basic'; # spent 11.4ms making 1 call to Mouse::Role::with, recursion: max depth 1, sum of overlapping time 11.4ms |
15 | |||||
16 | 1 | 5µs | 1 | 32µs | has usage => ( # spent 32µs making 1 call to Mouse::Role::has |
17 | is => 'rw', isa => 'Getopt::Long::Descriptive::Usage', | ||||
18 | traits => ['NoGetopt'], | ||||
19 | ); | ||||
20 | |||||
21 | # captures the options: --help --usage --? | ||||
22 | 1 | 7µs | 1 | 35µs | has help_flag => ( # spent 35µs making 1 call to Mouse::Role::has |
23 | is => 'ro', isa => 'Bool', | ||||
24 | traits => ['Getopt'], | ||||
25 | cmd_flag => 'help', | ||||
26 | cmd_aliases => [ qw(usage ?) ], | ||||
27 | documentation => 'Prints this usage information.', | ||||
28 | ); | ||||
29 | |||||
30 | # spent 266µs (11+255) within MouseX::Getopt::GLD::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/MouseX/Getopt/GLD.pm:33] which was called:
# once (11µs+255µs) by Mouse::Meta::Class::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux/Mouse/Meta/Class.pm:379] at line 379 of Mouse/Meta/Class.pm | ||||
31 | 1 | 1µs | shift; | ||
32 | 1 | 10µs | 1 | 255µs | shift->_gld_spec(@_); # spent 255µs making 1 call to MouseX::Getopt::GLD::_gld_spec |
33 | 1 | 7µs | 1 | 59µs | }; # spent 59µs making 1 call to Mouse::Role::around |
34 | |||||
35 | # spent 48.2ms (20µs+48.2) within MouseX::Getopt::GLD::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/MouseX/Getopt/GLD.pm:39] which was called:
# once (20µs+48.2ms) by Mouse::Meta::Class::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux/Mouse/Meta/Class.pm:379] at line 379 of Mouse/Meta/Class.pm | ||||
36 | 1 | 1µs | shift; | ||
37 | 1 | 2µs | my ($class, $params, $opt_spec) = @_; | ||
38 | 1 | 15µs | 2 | 48.2ms | return Getopt::Long::Descriptive::describe_options($class->_usage_format(%$params), @$opt_spec); # spent 48.2ms making 1 call to Getopt::Long::Descriptive::describe_options
# spent 3µs making 1 call to MouseX::Getopt::Basic::_usage_format |
39 | 1 | 7µs | 1 | 43µs | }; # spent 43µs making 1 call to Mouse::Role::around |
40 | |||||
41 | # spent 255µs (218+36) within MouseX::Getopt::GLD::_gld_spec which was called:
# once (218µs+36µs) by MouseX::Getopt::GLD::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/MouseX/Getopt/GLD.pm:33] at line 32 | ||||
42 | 1 | 2µs | my ( $class, %params ) = @_; | ||
43 | |||||
44 | 1 | 2µs | my ( @options, %name_to_init_arg ); | ||
45 | |||||
46 | 1 | 2µs | my $constructor_params = $params{params}; | ||
47 | |||||
48 | 1 | 3µs | foreach my $opt ( @{ $params{options} } ) { | ||
49 | 22 | 49µs | push @options, [ | ||
50 | $opt->{opt_string}, | ||||
51 | $opt->{doc} || ' ', # FIXME new GLD shouldn't need this hack | ||||
52 | { | ||||
53 | ( ( $opt->{required} && !exists($constructor_params->{$opt->{init_arg}}) ) ? (required => $opt->{required}) : () ), | ||||
54 | # NOTE: | ||||
55 | # remove this 'feature' because it didn't work | ||||
56 | # all the time, and so is better to not bother | ||||
57 | # since Mouse will handle the defaults just | ||||
58 | # fine anyway. | ||||
59 | # - SL | ||||
60 | #( exists $opt->{default} ? (default => $opt->{default}) : () ), | ||||
61 | }, | ||||
62 | ]; | ||||
63 | |||||
64 | 22 | 26µs | my $identifier = lc($opt->{name}); | ||
65 | 22 | 108µs | 22 | 36µs | $identifier =~ s/\W/_/g; # Getopt::Long does this to all option names # spent 36µs making 22 calls to MouseX::Getopt::GLD::CORE:subst, avg 2µs/call |
66 | |||||
67 | 22 | 59µs | $name_to_init_arg{$identifier} = $opt->{init_arg}; | ||
68 | } | ||||
69 | |||||
70 | 1 | 6µs | return ( \@options, \%name_to_init_arg ); | ||
71 | } | ||||
72 | |||||
73 | 2 | 28µs | 2 | 205µs | # spent 109µs (13+96) within MouseX::Getopt::GLD::BEGIN@73 which was called:
# once (13µs+96µs) by Mouse::Util::_try_load_one_class at line 73 # spent 109µs making 1 call to MouseX::Getopt::GLD::BEGIN@73
# spent 96µs making 1 call to Mouse::Exporter::do_unimport |
74 | |||||
75 | 1 | 11µs | 1; | ||
76 | |||||
77 | |||||
78 | __END__ | ||||
# spent 36µs within MouseX::Getopt::GLD::CORE:subst which was called 22 times, avg 2µs/call:
# 22 times (36µs+0s) by MouseX::Getopt::GLD::_gld_spec at line 65, avg 2µs/call |