Filename | /var/www/foswikidev/core/lib/Foswiki/Prefs/TopicRAM.pm |
Statements | Executed 3946 statements in 5.54ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
414 | 3 | 1 | 2.20ms | 3.80ms | insert | Foswiki::Prefs::TopicRAM::
365 | 1 | 1 | 779µs | 779µs | getLocal | Foswiki::Prefs::TopicRAM::
274 | 4 | 3 | 630µs | 630µs | get | Foswiki::Prefs::TopicRAM::
29 | 2 | 1 | 495µs | 47.6ms | new | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 494µs | 576µs | BEGIN@22 | Foswiki::Prefs::TopicRAM::
65 | 2 | 2 | 252µs | 252µs | finish | Foswiki::Prefs::TopicRAM::
54 | 1 | 1 | 232µs | 232µs | prefs | Foswiki::Prefs::TopicRAM::
8 | 1 | 1 | 14µs | 14µs | topicObject | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 13µs | 27µs | BEGIN@16 | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 10µs | 15µs | BEGIN@17 | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 4µs | 4µs | BEGIN@24 | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 4µs | 4µs | BEGIN@19 | Foswiki::Prefs::TopicRAM::
0 | 0 | 0 | 0s | 0s | localPrefs | Foswiki::Prefs::TopicRAM::
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 | |||||
7 | This 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 | |||||
14 | package Foswiki::Prefs::TopicRAM; | ||||
15 | |||||
16 | 2 | 29µs | 2 | 40µ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 # spent 27µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@16
# spent 14µs making 1 call to strict::import |
17 | 2 | 23µs | 2 | 19µ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 # spent 15µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@17
# spent 4µs making 1 call to warnings::import |
18 | |||||
19 | 2 | 38µs | 1 | 4µ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 # spent 4µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@19 |
20 | 1 | 9µs | our @ISA = qw(Foswiki::Prefs::BaseBackend); | ||
21 | |||||
22 | 2 | 115µs | 1 | 576µ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 # 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 | ||||
25 | 1 | 5µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
26 | require locale; | ||||
27 | import locale(); | ||||
28 | } | ||||
29 | 1 | 266µs | 1 | 4µ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 | ||||
32 | 29 | 19µs | my ( $proto, $topicObject ) = @_; | ||
33 | |||||
34 | 29 | 192µs | 29 | 76µs | my $this = $proto->SUPER::new(); # spent 76µs making 29 calls to Foswiki::Prefs::BaseBackend::new, avg 3µs/call |
35 | 29 | 26µs | $this->{values} = {}; | ||
36 | 29 | 13µs | $this->{local} = {}; | ||
37 | |||||
38 | 29 | 120µs | 58 | 47.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 | } | ||||
41 | 29 | 23µs | $this->{topicObject} = $topicObject; | ||
42 | |||||
43 | 29 | 63µ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 | ||||
47 | 65 | 12µs | my $this = shift; | ||
48 | 65 | 177µs | undef $this->{values}; | ||
49 | 65 | 16µs | undef $this->{local}; | ||
50 | 65 | 108µs | undef $this->{topicObject}; | ||
51 | } | ||||
52 | |||||
53 | =begin TML | ||||
54 | |||||
55 | ---++ ObjectMethod topicObject() -> $topicObject | ||||
56 | |||||
57 | Accessor 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 | ||||
62 | 8 | 3µs | my $this = shift; | ||
63 | 8 | 19µ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 | ||||
67 | 54 | 13µs | my $this = shift; | ||
68 | 54 | 294µs | return keys %{ $this->{values} }; | ||
69 | } | ||||
70 | |||||
71 | sub 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 | ||||
77 | 274 | 133µs | my ( $this, $key ) = @_; | ||
78 | 274 | 772µ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 | ||||
82 | 365 | 198µs | my ( $this, $key ) = @_; | ||
83 | 365 | 911µ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 | ||||
87 | 414 | 221µs | my ( $this, $type, $key, $value ) = @_; | ||
88 | |||||
89 | 414 | 375µs | 414 | 1.60ms | $this->cleanupInsertValue( \$value ); # spent 1.60ms making 414 calls to Foswiki::Prefs::BaseBackend::cleanupInsertValue, avg 4µs/call |
90 | |||||
91 | 414 | 151µs | my $index = $type eq 'Set' ? 'values' : 'local'; | ||
92 | 414 | 458µs | $this->{$index}{$key} = $value; | ||
93 | 414 | 736µs | return 1; | ||
94 | } | ||||
95 | |||||
96 | 1 | 3µs | 1; | ||
97 | __END__ |