← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 18:42:36 2015
Reported on Fri Jul 31 18:48:14 2015

Filename/var/www/foswikidev/core/lib/Foswiki/Prefs/Web.pm
StatementsExecuted 412 statements in 1.02ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11111555µs3.13msFoswiki::Prefs::Web::::getFoswiki::Prefs::Web::get
1711100µs226µsFoswiki::Prefs::Web::::finishFoswiki::Prefs::Web::finish
171182µs82µsFoswiki::Prefs::Web::::newFoswiki::Prefs::Web::new
81137µs51µsFoswiki::Prefs::Web::::isInTopOfStackFoswiki::Prefs::Web::isInTopOfStack
71126µs542µsFoswiki::Prefs::Web::::cloneStackFoswiki::Prefs::Web::cloneStack
11113µs26µsFoswiki::Prefs::Web::::BEGIN@18Foswiki::Prefs::Web::BEGIN@18
11111µs15µsFoswiki::Prefs::Web::::BEGIN@19Foswiki::Prefs::Web::BEGIN@19
1114µs4µsFoswiki::Prefs::Web::::BEGIN@21Foswiki::Prefs::Web::BEGIN@21
1112µs2µsFoswiki::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;
18226µs240µs
# spent 26µs (13+14) within Foswiki::Prefs::Web::BEGIN@18 which was called: # once (13µs+14µs) by Foswiki::Prefs::BEGIN@78 at line 18
use strict;
# spent 26µs making 1 call to Foswiki::Prefs::Web::BEGIN@18 # spent 14µs making 1 call to strict::import
19249µs219µs
# spent 15µs (11+4) within Foswiki::Prefs::Web::BEGIN@19 which was called: # once (11µs+4µs) by Foswiki::Prefs::BEGIN@78 at line 19
use warnings;
# spent 15µs making 1 call to Foswiki::Prefs::Web::BEGIN@19 # spent 4µs making 1 call to warnings::import
20
21
# spent 4µs within Foswiki::Prefs::Web::BEGIN@21 which was called: # once (4µs+0s) by Foswiki::Prefs::BEGIN@78 at line 26
BEGIN {
2215µs if ( $Foswiki::cfg{UseLocale} ) {
23 require locale;
24 import locale();
25 }
261219µs14µs}
# spent 4µs making 1 call to Foswiki::Prefs::Web::BEGIN@21
27
28=begin TML
29
30---++ ClassMethod new( $session )
31
32Creates a new WebPrefs object.
33
34=cut
35
36
# spent 82µs within Foswiki::Prefs::Web::new which was called 17 times, avg 5µs/call: # 17 times (82µs+0s) by Foswiki::Prefs::_getWebPrefsObj at line 210 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 5µs/call
sub new {
37176µs my $proto = shift;
38176µs my $class = ref($proto) || $proto;
39179µs my ( $stack, $level ) = @_;
401721µs my $this = {
41 stack => $stack,
42 level => $level,
43 };
441756µs return bless $this, $class;
45}
46
47=begin TML
48
49---++ ObjectMethod finish()
50
51Break circular references.
52
53=cut
54
55# Note to developers; please undef *all* fields in the object explicitly,
56# whether they are references or not. That way this method is "golden
57# documentation" of the live fields in the object.
58
# spent 226µs (100+126) within Foswiki::Prefs::Web::finish which was called 17 times, avg 13µs/call: # 17 times (100µs+126µs) by Foswiki::Prefs::finish at line 135 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 13µs/call
sub finish {
59174µs my $this = shift;
601755µs17126µs $this->{stack}->finish() if $this->{stack};
# spent 126µs making 17 calls to Foswiki::Prefs::Stack::finish, avg 7µs/call
61178µs undef $this->{stack};
621728µs undef $this->{level};
63}
64
65=begin TML
66
67---++ ObjectMethod isInTopOfStack() -> $boolean
68
69Returns true if this web is the hihger of the underlying stack object.
70
71=cut
72
73
# spent 51µs (37+14) within Foswiki::Prefs::Web::isInTopOfStack which was called 8 times, avg 6µs/call: # 8 times (37µs+14µs) by Foswiki::Prefs::_getWebPrefsObj at line 195 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 6µs/call
sub isInTopOfStack {
7482µs my $this = shift;
75829µs814µs return $this->{level} == $this->{stack}->size() - 1;
# spent 14µs making 8 calls to Foswiki::Prefs::Stack::size, avg 2µs/call
76}
77
78=begin TML
79
80---++ ObjectMethod stack() -> $stack
81
82Read-only accessor to the underlying stack object.
83
84=cut
85
86
# spent 2µs within Foswiki::Prefs::Web::stack which was called: # once (2µs+0s) by Foswiki::Prefs::_getWebPrefsObj at line 195 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm
sub stack {
8715µs return $_[0]->{stack};
88}
89
90=begin TML
91
92---++ ObjectMethod cloneStack($level) -> $stack
93
94This method clone the underlying stack object, to the given $level. See
95Foswiki::Prefs::Stack::clone documentation.
96
97This method exists because WebPrefs objects are used by Foswiki::Prefs instead
98of bar Foswiki::Prefs::Stack and this operation is needed.
99
100=cut
101
102
# spent 542µs (26+516) within Foswiki::Prefs::Web::cloneStack which was called 7 times, avg 77µs/call: # 7 times (26µs+516µs) by Foswiki::Prefs::_getWebPrefsObj at line 195 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 77µs/call
sub cloneStack {
10373µs my ( $this, $level ) = @_;
104722µs7516µs return $this->{stack}->clone($level);
# spent 516µs making 7 calls to Foswiki::Prefs::Stack::clone, avg 74µs/call
105}
106
107=begin TML
108
109---++ ObjectMethod get($pref) -> $value
110
111Returns the $value of the given $pref.
112
113=cut
114
115
# spent 3.13ms (555µs+2.57) within Foswiki::Prefs::Web::get which was called 111 times, avg 28µs/call: # 111 times (555µs+2.57ms) by Foswiki::Meta::getPreference at line 681 of /var/www/foswikidev/core/lib/Foswiki/Meta.pm, avg 28µs/call
sub get {
11611168µs my ( $this, $key ) = @_;
117111399µs1112.57ms $this->{stack}->getPreference( $key, $this->{level} );
# spent 2.57ms making 111 calls to Foswiki::Prefs::Stack::getPreference, avg 23µs/call
118}
119
12012µs1;
121__END__