← 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/TopicRAM.pm
StatementsExecuted 3946 statements in 5.54ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
414312.20ms3.80msFoswiki::Prefs::TopicRAM::::insertFoswiki::Prefs::TopicRAM::insert
36511779µs779µsFoswiki::Prefs::TopicRAM::::getLocalFoswiki::Prefs::TopicRAM::getLocal
27443630µs630µsFoswiki::Prefs::TopicRAM::::getFoswiki::Prefs::TopicRAM::get
2921495µs47.6msFoswiki::Prefs::TopicRAM::::newFoswiki::Prefs::TopicRAM::new
111494µs576µsFoswiki::Prefs::TopicRAM::::BEGIN@22Foswiki::Prefs::TopicRAM::BEGIN@22
6522252µs252µsFoswiki::Prefs::TopicRAM::::finishFoswiki::Prefs::TopicRAM::finish
5411232µs232µsFoswiki::Prefs::TopicRAM::::prefsFoswiki::Prefs::TopicRAM::prefs
81114µs14µsFoswiki::Prefs::TopicRAM::::topicObjectFoswiki::Prefs::TopicRAM::topicObject
11113µs27µsFoswiki::Prefs::TopicRAM::::BEGIN@16Foswiki::Prefs::TopicRAM::BEGIN@16
11110µs15µsFoswiki::Prefs::TopicRAM::::BEGIN@17Foswiki::Prefs::TopicRAM::BEGIN@17
1114µs4µsFoswiki::Prefs::TopicRAM::::BEGIN@24Foswiki::Prefs::TopicRAM::BEGIN@24
1114µs4µsFoswiki::Prefs::TopicRAM::::BEGIN@19Foswiki::Prefs::TopicRAM::BEGIN@19
0000s0sFoswiki::Prefs::TopicRAM::::localPrefsFoswiki::Prefs::TopicRAM::localPrefs
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---+ package Foswiki::Prefs::TopicRAM
6
7This is a preference backend used to get preferences defined in a topic.
8
9=cut
10
11# See documentation on Foswiki::Prefs::BaseBackend to get details about the
12# methods.
13
14package Foswiki::Prefs::TopicRAM;
15
16229µs240µs
# spent 27µs (13+14) within Foswiki::Prefs::TopicRAM::BEGIN@16 which was called: # once (13µs+14µs) by Foswiki::Prefs::BEGIN@1 at line 16
use strict;
# spent 27µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@16 # spent 14µs making 1 call to strict::import
17223µs219µs
# spent 15µs (10+4) within Foswiki::Prefs::TopicRAM::BEGIN@17 which was called: # once (10µs+4µs) by Foswiki::Prefs::BEGIN@1 at line 17
use warnings;
# spent 15µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@17 # spent 4µs making 1 call to warnings::import
18
19238µs14µs
# spent 4µs within Foswiki::Prefs::TopicRAM::BEGIN@19 which was called: # once (4µs+0s) by Foswiki::Prefs::BEGIN@1 at line 19
use Foswiki::Prefs::BaseBackend ();
# spent 4µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@19
2019µsour @ISA = qw(Foswiki::Prefs::BaseBackend);
21
222115µs1576µs
# spent 576µs (494+82) within Foswiki::Prefs::TopicRAM::BEGIN@22 which was called: # once (494µs+82µs) by Foswiki::Prefs::BEGIN@1 at line 22
use Foswiki::Prefs::Parser ();
# spent 576µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@22
23
24
# spent 4µs within Foswiki::Prefs::TopicRAM::BEGIN@24 which was called: # once (4µs+0s) by Foswiki::Prefs::BEGIN@1 at line 29
BEGIN {
2515µs if ( $Foswiki::cfg{UseLocale} ) {
26 require locale;
27 import locale();
28 }
291266µs14µs}
# spent 4µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@24
30
31
# spent 47.6ms (495µs+47.1) within Foswiki::Prefs::TopicRAM::new which was called 29 times, avg 1.64ms/call: # 28 times (472µs+46.8ms) by Foswiki::Prefs::_getBackend at line 148 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 1.69ms/call # once (23µs+266µs) by Foswiki::Prefs::loadPreferences at line 237 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm
sub new {
322919µs my ( $proto, $topicObject ) = @_;
33
3429192µs2976µs my $this = $proto->SUPER::new();
# spent 76µs making 29 calls to Foswiki::Prefs::BaseBackend::new, avg 3µs/call
352926µs $this->{values} = {};
362913µs $this->{local} = {};
37
3829120µs5847.0ms if ( $topicObject->existsInStore() ) {
# spent 45.0ms making 29 calls to Foswiki::Prefs::Parser::parse, avg 1.55ms/call # spent 2.01ms making 29 calls to Foswiki::Meta::existsInStore, avg 69µs/call
39 Foswiki::Prefs::Parser::parse( $topicObject, $this );
40 }
412923µs $this->{topicObject} = $topicObject;
42
432963µs return $this;
44}
45
46
# spent 252µs within Foswiki::Prefs::TopicRAM::finish which was called 65 times, avg 4µs/call: # 37 times (160µs+0s) by Foswiki::Prefs::Stack::finish at line 72 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm, avg 4µs/call # 28 times (92µs+0s) by Foswiki::Prefs::finish at line 129 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 3µs/call
sub finish {
476512µs my $this = shift;
4865177µs undef $this->{values};
496516µs undef $this->{local};
5065108µs undef $this->{topicObject};
51}
52
53=begin TML
54
55---++ ObjectMethod topicObject() -> $topicObject
56
57Accessor to the topicObject used to create this object.
58
59=cut
60
61
# spent 14µs within Foswiki::Prefs::TopicRAM::topicObject which was called 8 times, avg 2µs/call: # 8 times (14µs+0s) by Foswiki::Prefs::popTopicContext at line 318 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 2µs/call
sub topicObject {
6283µs my $this = shift;
63819µs return $this->{topicObject};
64}
65
66
# spent 232µs within Foswiki::Prefs::TopicRAM::prefs which was called 54 times, avg 4µs/call: # 54 times (232µs+0s) by Foswiki::Prefs::Stack::newLevel at line 199 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm, avg 4µs/call
sub prefs {
675413µs my $this = shift;
6854294µs return keys %{ $this->{values} };
69}
70
71sub localPrefs {
72 my $this = shift;
73 return keys %{ $this->{local} };
74}
75
76
# spent 630µs within Foswiki::Prefs::TopicRAM::get which was called 274 times, avg 2µs/call: # 108 times (293µs+0s) by Foswiki::Prefs::Stack::getPreference at line 262 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm, avg 3µs/call # 99 times (221µs+0s) by Foswiki::Prefs::getPreference at line 455 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 2µs/call # 54 times (98µs+0s) by Foswiki::Prefs::Stack::newLevel at line 205 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm, avg 2µs/call # 13 times (18µs+0s) by Foswiki::Meta::getPreference at line 681 of /var/www/foswikidev/core/lib/Foswiki/Meta.pm, avg 1µs/call
sub get {
77274133µs my ( $this, $key ) = @_;
78274772µs return $this->{values}{$key};
79}
80
81
# spent 779µs within Foswiki::Prefs::TopicRAM::getLocal which was called 365 times, avg 2µs/call: # 365 times (779µs+0s) by Foswiki::Prefs::getPreference at line 448 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 2µs/call
sub getLocal {
82365198µs my ( $this, $key ) = @_;
83365911µs return $this->{local}{$key};
84}
85
86
# spent 3.80ms (2.20+1.60) within Foswiki::Prefs::TopicRAM::insert which was called 414 times, avg 9µs/call: # 231 times (1.25ms+981µs) by Foswiki::Prefs::Parser::parse at line 65 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Parser.pm, avg 10µs/call # 182 times (943µs+616µs) by Foswiki::Prefs::Parser::parse at line 51 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Parser.pm, avg 9µs/call # once (6µs+4µs) by Foswiki::Prefs::Parser::parse at line 80 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Parser.pm
sub insert {
87414221µs my ( $this, $type, $key, $value ) = @_;
88
89414375µs4141.60ms $this->cleanupInsertValue( \$value );
# spent 1.60ms making 414 calls to Foswiki::Prefs::BaseBackend::cleanupInsertValue, avg 4µs/call
90
91414151µs my $index = $type eq 'Set' ? 'values' : 'local';
92414458µs $this->{$index}{$key} = $value;
93414736µs return 1;
94}
95
9613µs1;
97__END__