Filename | /var/www/foswiki11/lib/Foswiki/Prefs/TopicRAM.pm |
Statements | Executed 16107 statements in 36.8ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1697 | 4 | 1 | 15.5ms | 22.4ms | insert | Foswiki::Prefs::TopicRAM::
336 | 2 | 1 | 6.49ms | 9.72s | new | Foswiki::Prefs::TopicRAM::
1537 | 4 | 3 | 3.54ms | 3.54ms | get | Foswiki::Prefs::TopicRAM::
476 | 1 | 1 | 1.21ms | 1.21ms | getLocal | Foswiki::Prefs::TopicRAM::
244 | 2 | 2 | 968µs | 968µs | finish | Foswiki::Prefs::TopicRAM::
123 | 1 | 1 | 745µs | 745µs | prefs | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 419µs | 487µs | BEGIN@22 | Foswiki::Prefs::TopicRAM::
6 | 1 | 1 | 24µs | 24µs | topicObject | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 13µs | 26µs | BEGIN@16 | Foswiki::Prefs::TopicRAM::
1 | 1 | 1 | 9µs | 15µs | BEGIN@17 | 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 | 27µs | 2 | 38µs | # spent 26µs (13+13) within Foswiki::Prefs::TopicRAM::BEGIN@16 which was called:
# once (13µs+13µs) by Foswiki::Prefs::BEGIN@1 at line 16 # spent 26µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@16
# spent 13µs making 1 call to strict::import |
17 | 2 | 25µs | 2 | 21µs | # spent 15µs (9+6) within Foswiki::Prefs::TopicRAM::BEGIN@17 which was called:
# once (9µs+6µs) by Foswiki::Prefs::BEGIN@1 at line 17 # spent 15µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@17
# spent 6µs making 1 call to warnings::import |
18 | |||||
19 | 2 | 33µ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 | 8µs | our @ISA = qw(Foswiki::Prefs::BaseBackend); | ||
21 | |||||
22 | 2 | 323µs | 1 | 487µs | # spent 487µs (419+68) within Foswiki::Prefs::TopicRAM::BEGIN@22 which was called:
# once (419µs+68µs) by Foswiki::Prefs::BEGIN@1 at line 22 # spent 487µs making 1 call to Foswiki::Prefs::TopicRAM::BEGIN@22 |
23 | |||||
24 | # spent 9.72s (6.49ms+9.72) within Foswiki::Prefs::TopicRAM::new which was called 336 times, avg 28.9ms/call:
# 233 times (3.70ms+31.2ms) by Foswiki::Prefs::loadPreferences at line 232 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 150µs/call
# 103 times (2.80ms+9.68s) by Foswiki::Prefs::_getBackend at line 143 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 94.0ms/call | ||||
25 | 336 | 228µs | my ( $proto, $topicObject ) = @_; | ||
26 | |||||
27 | 336 | 2.56ms | 336 | 1.13ms | my $this = $proto->SUPER::new(); # spent 1.13ms making 336 calls to Foswiki::Prefs::BaseBackend::new, avg 3µs/call |
28 | 336 | 452µs | $this->{values} = {}; | ||
29 | 336 | 191µs | $this->{local} = {}; | ||
30 | |||||
31 | 336 | 1.19ms | 671 | 9.71s | if ( $topicObject->existsInStore() ) { # spent 9.69s making 335 calls to Foswiki::Prefs::Parser::parse, avg 28.9ms/call
# spent 23.5ms making 336 calls to Foswiki::Meta::existsInStore, avg 70µs/call |
32 | Foswiki::Prefs::Parser::parse( $topicObject, $this ); | ||||
33 | } | ||||
34 | 336 | 315µs | $this->{topicObject} = $topicObject; | ||
35 | |||||
36 | 336 | 1.00ms | return $this; | ||
37 | } | ||||
38 | |||||
39 | # spent 968µs within Foswiki::Prefs::TopicRAM::finish which was called 244 times, avg 4µs/call:
# 141 times (279µs+0s) by Foswiki::Prefs::Stack::finish at line 65 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm, avg 2µs/call
# 103 times (689µs+0s) by Foswiki::Prefs::finish at line 122 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 7µs/call | ||||
40 | 244 | 52µs | my $this = shift; | ||
41 | 244 | 614µs | undef $this->{values}; | ||
42 | 244 | 74µs | undef $this->{local}; | ||
43 | 244 | 499µs | undef $this->{topicObject}; | ||
44 | } | ||||
45 | |||||
46 | =begin TML | ||||
47 | |||||
48 | ---++ ObjectMethod topicObject() -> $topicObject | ||||
49 | |||||
50 | Accessor to the topicObject used to create this object. | ||||
51 | |||||
52 | =cut | ||||
53 | |||||
54 | # spent 24µs within Foswiki::Prefs::TopicRAM::topicObject which was called 6 times, avg 4µs/call:
# 6 times (24µs+0s) by Foswiki::Prefs::popTopicContext at line 313 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 4µs/call | ||||
55 | 6 | 4µs | my $this = shift; | ||
56 | 6 | 24µs | return $this->{topicObject}; | ||
57 | } | ||||
58 | |||||
59 | # spent 745µs within Foswiki::Prefs::TopicRAM::prefs which was called 123 times, avg 6µs/call:
# 123 times (745µs+0s) by Foswiki::Prefs::Stack::newLevel at line 192 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm, avg 6µs/call | ||||
60 | 123 | 57µs | my $this = shift; | ||
61 | 123 | 962µs | return keys %{ $this->{values} }; | ||
62 | } | ||||
63 | |||||
64 | sub localPrefs { | ||||
65 | my $this = shift; | ||||
66 | return keys %{ $this->{local} }; | ||||
67 | } | ||||
68 | |||||
69 | # spent 3.54ms within Foswiki::Prefs::TopicRAM::get which was called 1537 times, avg 2µs/call:
# 858 times (2.13ms+0s) by Foswiki::Prefs::Stack::getPreference at line 255 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm, avg 2µs/call
# 475 times (707µs+0s) by Foswiki::Meta::getPreference at line 596 of /var/www/foswiki11/lib/Foswiki/Meta.pm, avg 1µs/call
# 123 times (454µs+0s) by Foswiki::Prefs::Stack::newLevel at line 198 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm, avg 4µs/call
# 81 times (244µs+0s) by Foswiki::Prefs::getPreference at line 450 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 3µs/call | ||||
70 | 1537 | 871µs | my ( $this, $key ) = @_; | ||
71 | 1537 | 4.52ms | return $this->{values}{$key}; | ||
72 | } | ||||
73 | |||||
74 | # spent 1.21ms within Foswiki::Prefs::TopicRAM::getLocal which was called 476 times, avg 3µs/call:
# 476 times (1.21ms+0s) by Foswiki::Prefs::getPreference at line 443 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 3µs/call | ||||
75 | 476 | 281µs | my ( $this, $key ) = @_; | ||
76 | 476 | 1.42ms | return $this->{local}{$key}; | ||
77 | } | ||||
78 | |||||
79 | # spent 22.4ms (15.5+6.90) within Foswiki::Prefs::TopicRAM::insert which was called 1697 times, avg 13µs/call:
# 875 times (8.08ms+3.69ms) by Foswiki::Prefs::Parser::parse at line 58 of /var/www/foswiki11/lib/Foswiki/Prefs/Parser.pm, avg 13µs/call
# 810 times (7.32ms+3.15ms) by Foswiki::Prefs::Parser::parse at line 44 of /var/www/foswiki11/lib/Foswiki/Prefs/Parser.pm, avg 13µs/call
# 9 times (56µs+42µs) by Foswiki::Prefs::Parser::parse at line 73 of /var/www/foswiki11/lib/Foswiki/Prefs/Parser.pm, avg 11µs/call
# 3 times (26µs+10µs) by Foswiki::Prefs::Parser::parse at line 63 of /var/www/foswiki11/lib/Foswiki/Prefs/Parser.pm, avg 12µs/call | ||||
80 | 1697 | 1.55ms | my ( $this, $type, $key, $value ) = @_; | ||
81 | |||||
82 | 1697 | 2.70ms | 1697 | 6.90ms | $this->cleanupInsertValue( \$value ); # spent 6.90ms making 1697 calls to Foswiki::Prefs::BaseBackend::cleanupInsertValue, avg 4µs/call |
83 | |||||
84 | 1697 | 1.06ms | my $index = $type eq 'Set' ? 'values' : 'local'; | ||
85 | 1697 | 3.00ms | $this->{$index}{$key} = $value; | ||
86 | 1697 | 12.7ms | return 1; | ||
87 | } | ||||
88 | |||||
89 | 1 | 3µs | 1; | ||
90 | __END__ |