← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/local/src/github.com/foswiki/core/bin/view
  Run on Sun Dec 4 17:17:59 2011
Reported on Sun Dec 4 17:27:00 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Form/Radio.pm
StatementsExecuted 15 statements in 539µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11152µs118µsFoswiki::Form::Radio::::newFoswiki::Form::Radio::new
11134µs42µsFoswiki::Form::Radio::::BEGIN@4Foswiki::Form::Radio::BEGIN@4
11121µs43µsFoswiki::Form::Radio::::BEGIN@5Foswiki::Form::Radio::BEGIN@5
1119µs9µsFoswiki::Form::Radio::::BEGIN@7Foswiki::Form::Radio::BEGIN@7
1112µs2µsFoswiki::Form::Radio::::CORE:substFoswiki::Form::Radio::CORE:subst (opcode)
0000s0sFoswiki::Form::Radio::::renderForEditFoswiki::Form::Radio::renderForEdit
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# See bottom of file for license and copyright information
2package Foswiki::Form::Radio;
3
4252µs251µs
# spent 42µs (34+9) within Foswiki::Form::Radio::BEGIN@4 which was called: # once (34µs+9µs) by Foswiki::Form::createField at line 4
use strict;
# spent 42µs making 1 call to Foswiki::Form::Radio::BEGIN@4 # spent 9µs making 1 call to strict::import
5248µs266µs
# spent 43µs (21+23) within Foswiki::Form::Radio::BEGIN@5 which was called: # once (21µs+23µs) by Foswiki::Form::createField at line 5
use warnings;
# spent 43µs making 1 call to Foswiki::Form::Radio::BEGIN@5 # spent 22µs making 1 call to warnings::import
6
72366µs19µs
# spent 9µs within Foswiki::Form::Radio::BEGIN@7 which was called: # once (9µs+0s) by Foswiki::Form::createField at line 7
use Foswiki::Form::ListFieldDefinition ();
# spent 9µs making 1 call to Foswiki::Form::Radio::BEGIN@7
8114µsour @ISA = ('Foswiki::Form::ListFieldDefinition');
9
10
# spent 118µs (52+66) within Foswiki::Form::Radio::new which was called: # once (52µs+66µs) by Foswiki::Form::createField at line 311 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Form.pm
sub new {
11753µs my $class = shift;
12164µs my $this = $class->SUPER::new(@_);
# spent 64µs making 1 call to Foswiki::Form::FieldDefinition::new
13 $this->{size} ||= 0;
1412µs $this->{size} =~ s/\D//g;
# spent 2µs making 1 call to Foswiki::Form::Radio::CORE:subst
15 $this->{size} ||= 0;
16
17 # SMELL: Non-zero -columns attribute forces CGI::radio_group() to use
18 # HTML3 tables for layout
19 $this->{size} = 4 if ( $this->{size} < 1 );
20
21 return $this;
22}
23
24sub renderForEdit {
25 my ( $this, $topicObject, $value ) = @_;
26
27 my $selected = '';
28 my $session = $this->{session};
29 my %attrs;
30 foreach my $item ( @{ $this->getOptions() } ) {
31 $attrs{$item} = {
32 class => $this->cssClasses('foswikiRadioButton'),
33 title => $topicObject->expandMacros($item)
34 };
35
36 $selected = $item if ( $item eq $value );
37 }
38
39 return (
40 '',
41 CGI::radio_group(
42 -name => $this->{name},
43 -values => $this->getOptions(),
44 -default => $selected,
45 -columns => $this->{size},
46 -attributes => \%attrs
47 )
48 );
49}
50
5116µs1;
52__END__
 
# spent 2µs within Foswiki::Form::Radio::CORE:subst which was called: # once (2µs+0s) by Foswiki::Form::Radio::new at line 14
sub Foswiki::Form::Radio::CORE:subst; # opcode