← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 19:05:14 2015
Reported on Fri Jul 31 19:08:09 2015

Filename/var/www/foswiki11/lib/Foswiki/Prefs/Web.pm
StatementsExecuted 2744 statements in 5.93ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
861117.60ms28.8msFoswiki::Prefs::Web::::getFoswiki::Prefs::Web::get
9211797µs797µsFoswiki::Prefs::Web::::newFoswiki::Prefs::Web::new
9211683µs1.51msFoswiki::Prefs::Web::::finishFoswiki::Prefs::Web::finish
5111376µs478µsFoswiki::Prefs::Web::::isInTopOfStackFoswiki::Prefs::Web::isInTopOfStack
3611209µs4.12msFoswiki::Prefs::Web::::cloneStackFoswiki::Prefs::Web::cloneStack
151145µs45µsFoswiki::Prefs::Web::::stackFoswiki::Prefs::Web::stack
11114µs28µsFoswiki::Prefs::Web::::BEGIN@18Foswiki::Prefs::Web::BEGIN@18
1119µs15µsFoswiki::Prefs::Web::::BEGIN@19Foswiki::Prefs::Web::BEGIN@19
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;
18228µs242µs
# spent 28µs (14+14) within Foswiki::Prefs::Web::BEGIN@18 which was called: # once (14µs+14µs) by Foswiki::Prefs::BEGIN@71 at line 18
use strict;
# spent 28µs making 1 call to Foswiki::Prefs::Web::BEGIN@18 # spent 14µs making 1 call to strict::import
192281µs220µs
# spent 15µs (9+6) within Foswiki::Prefs::Web::BEGIN@19 which was called: # once (9µs+6µs) by Foswiki::Prefs::BEGIN@71 at line 19
use warnings;
# spent 15µs making 1 call to Foswiki::Prefs::Web::BEGIN@19 # spent 6µ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 797µs within Foswiki::Prefs::Web::new which was called 92 times, avg 9µs/call: # 92 times (797µs+0s) by Foswiki::Prefs::_getWebPrefsObj at line 205 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 9µs/call
sub new {
309255µs my $proto = shift;
319266µs my $class = ref($proto) || $proto;
329276µs my ( $stack, $level ) = @_;
3392221µs my $this = {
34 stack => $stack,
35 level => $level,
36 };
3792494µs 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 1.51ms (683µs+830µs) within Foswiki::Prefs::Web::finish which was called 92 times, avg 16µs/call: # 92 times (683µs+830µs) by Foswiki::Prefs::finish at line 128 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 16µs/call
sub finish {
529221µs my $this = shift;
5392413µs92830µs $this->{stack}->finish() if $this->{stack};
# spent 830µs making 92 calls to Foswiki::Prefs::Stack::finish, avg 9µs/call
549250µs undef $this->{stack};
5592164µs 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
66
# spent 478µs (376+102) within Foswiki::Prefs::Web::isInTopOfStack which was called 51 times, avg 9µs/call: # 51 times (376µs+102µs) by Foswiki::Prefs::_getWebPrefsObj at line 190 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 9µs/call
sub isInTopOfStack {
675117µs my $this = shift;
6851305µs51102µs return $this->{level} == $this->{stack}->size() - 1;
# spent 102µs making 51 calls to Foswiki::Prefs::Stack::size, avg 2µs/call
69}
70
71=begin TML
72
73---++ ObjectMethod stack() -> $stack
74
75Read-only accessor to the underlying stack object.
76
77=cut
78
79
# spent 45µs within Foswiki::Prefs::Web::stack which was called 15 times, avg 3µs/call: # 15 times (45µs+0s) by Foswiki::Prefs::_getWebPrefsObj at line 190 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 3µs/call
sub stack {
801566µs 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
95
# spent 4.12ms (209µs+3.91) within Foswiki::Prefs::Web::cloneStack which was called 36 times, avg 114µs/call: # 36 times (209µs+3.91ms) by Foswiki::Prefs::_getWebPrefsObj at line 190 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 114µs/call
sub cloneStack {
963623µs my ( $this, $level ) = @_;
9736168µs363.91ms return $this->{stack}->clone($level);
# spent 3.91ms making 36 calls to Foswiki::Prefs::Stack::clone, avg 109µs/call
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 28.8ms (7.60+21.2) within Foswiki::Prefs::Web::get which was called 861 times, avg 33µs/call: # 861 times (7.60ms+21.2ms) by Foswiki::Meta::getPreference at line 596 of /var/www/foswiki11/lib/Foswiki/Meta.pm, avg 33µs/call
sub get {
109861502µs my ( $this, $key ) = @_;
1108612.98ms86121.2ms $this->{stack}->getPreference( $key, $this->{level} );
# spent 21.2ms making 861 calls to Foswiki::Prefs::Stack::getPreference, avg 25µs/call
111}
112
11312µs1;
114__END__