← 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:26:42 2011

Filename/usr/local/src/github.com/foswiki/core/lib/Foswiki/Prefs/Web.pm
StatementsExecuted 166 statements in 1.54ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6711893µs3.41msFoswiki::Prefs::Web::::getFoswiki::Prefs::Web::get
311102µs102µsFoswiki::Prefs::Web::::newFoswiki::Prefs::Web::new
31182µs201µsFoswiki::Prefs::Web::::finishFoswiki::Prefs::Web::finish
11124µs32µsFoswiki::Prefs::Web::::BEGIN@18Foswiki::Prefs::Web::BEGIN@18
11116µs35µsFoswiki::Prefs::Web::::BEGIN@19Foswiki::Prefs::Web::BEGIN@19
0000s0sFoswiki::Prefs::Web::::cloneStackFoswiki::Prefs::Web::cloneStack
0000s0sFoswiki::Prefs::Web::::isInTopOfStackFoswiki::Prefs::Web::isInTopOfStack
0000s0sFoswiki::Prefs::Web::::stackFoswiki::Prefs::Web::stack
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
2
3=begin TML
4
5---+ UNPUBLISHED package Foswiki::Prefs::Web
6
7This class is a simple wrapper around Foswiki::Prefs::Stack. Since Webs has an
8hierarchical structure it's needed only one stack to deal with preferences from
9Web and Web/Subweb and Web/Subweb/Subsubweb. This class has a reference to a
10stack and the level where the web is.
11
12This class is used by Foswiki::Prefs to pass web preferences to Foswiki::Meta
13and should not be used for anything else.
14
15=cut
16
17package Foswiki::Prefs::Web;
18245µs239µs
# spent 32µs (24+7) within Foswiki::Prefs::Web::BEGIN@18 which was called: # once (24µs+7µs) by Foswiki::Prefs::BEGIN@71 at line 18
use strict;
# spent 32µs making 1 call to Foswiki::Prefs::Web::BEGIN@18 # spent 8µs making 1 call to strict::import
192484µs253µs
# spent 35µs (16+18) within Foswiki::Prefs::Web::BEGIN@19 which was called: # once (16µs+18µs) by Foswiki::Prefs::BEGIN@71 at line 19
use warnings;
# spent 35µs making 1 call to Foswiki::Prefs::Web::BEGIN@19 # spent 18µs making 1 call to warnings::import
20
21=begin TML
22
23---++ ClassMethod new( $session )
24
25Creates a new WebPrefs object.
26
27=cut
28
29
# spent 102µs within Foswiki::Prefs::Web::new which was called 3 times, avg 34µs/call: # 3 times (102µs+0s) by Foswiki::Prefs::_getWebPrefsObj at line 203 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Prefs.pm, avg 34µs/call
sub new {
301599µs my $proto = shift;
31 my $class = ref($proto) || $proto;
32 my ( $stack, $level ) = @_;
33 my $this = {
34 stack => $stack,
35 level => $level,
36 };
37 return bless $this, $class;
38}
39
40=begin TML
41
42---++ ObjectMethod finish()
43
44Break circular references.
45
46=cut
47
48# Note to developers; please undef *all* fields in the object explicitly,
49# whether they are references or not. That way this method is "golden
50# documentation" of the live fields in the object.
51
# spent 201µs (82+119) within Foswiki::Prefs::Web::finish which was called 3 times, avg 67µs/call: # 3 times (82µs+119µs) by Foswiki::Prefs::finish at line 128 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Prefs.pm, avg 67µs/call
sub finish {
521279µs my $this = shift;
533119µs $this->{stack}->finish() if $this->{stack};
# spent 119µs making 3 calls to Foswiki::Prefs::Stack::finish, avg 40µs/call
54 undef $this->{stack};
55 undef $this->{level};
56}
57
58=begin TML
59
60---++ ObjectMethod isInTopOfStack() -> $boolean
61
62Returns true if this web is the hihger of the underlying stack object.
63
64=cut
65
66sub isInTopOfStack {
67 my $this = shift;
68 return $this->{level} == $this->{stack}->size() - 1;
69}
70
71=begin TML
72
73---++ ObjectMethod stack() -> $stack
74
75Read-only accessor to the underlying stack object.
76
77=cut
78
79sub stack {
80 return $_[0]->{stack};
81}
82
83=begin TML
84
85---++ ObjectMethod cloneStack($level) -> $stack
86
87This method clone the underlying stack object, to the given $level. See
88Foswiki::Prefs::Stack::clone documentation.
89
90This method exists because WebPrefs objects are used by Foswiki::Prefs instead
91of bar Foswiki::Prefs::Stack and this operation is needed.
92
93=cut
94
95sub cloneStack {
96 my ( $this, $level ) = @_;
97 return $this->{stack}->clone($level);
98}
99
100=begin TML
101
102---++ ObjectMethod get($pref) -> $value
103
104Returns the $value of the given $pref.
105
106=cut
107
108
# spent 3.41ms (893µs+2.52) within Foswiki::Prefs::Web::get which was called 67 times, avg 51µs/call: # 67 times (893µs+2.52ms) by Foswiki::Meta::getPreference at line 662 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Meta.pm, avg 51µs/call
sub get {
109134833µs my ( $this, $key ) = @_;
110672.52ms $this->{stack}->getPreference( $key, $this->{level} );
# spent 2.52ms making 67 calls to Foswiki::Prefs::Stack::getPreference, avg 38µs/call
111}
112
11314µs1;
114__END__