Filename | /var/www/foswikidev/core/lib/Foswiki/Prefs/HASH.pm |
Statements | Executed 334 statements in 826µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 417µs | 496µs | BEGIN@20 | Foswiki::Prefs::HASH::
62 | 1 | 1 | 278µs | 466µs | insert | Foswiki::Prefs::HASH::
9 | 1 | 1 | 122µs | 154µs | new | Foswiki::Prefs::HASH::
11 | 2 | 2 | 24µs | 24µs | get | Foswiki::Prefs::HASH::
9 | 1 | 1 | 17µs | 17µs | prefs | Foswiki::Prefs::HASH::
1 | 1 | 1 | 13µs | 26µs | BEGIN@17 | Foswiki::Prefs::HASH::
1 | 1 | 1 | 9µs | 13µs | BEGIN@18 | Foswiki::Prefs::HASH::
1 | 1 | 1 | 4µs | 4µs | BEGIN@23 | Foswiki::Prefs::HASH::
1 | 1 | 1 | 2µs | 2µs | finish | Foswiki::Prefs::HASH::
0 | 0 | 0 | 0s | 0s | getLocal | Foswiki::Prefs::HASH::
0 | 0 | 0 | 0s | 0s | localPrefs | Foswiki::Prefs::HASH::
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::HASH | ||||
6 | |||||
7 | This is a simple preferences backend that keeps keys and values as an in-memory | ||||
8 | hash. | ||||
9 | |||||
10 | =cut | ||||
11 | |||||
12 | # See documentation on Foswiki::Prefs::BaseBackend to get details about the | ||||
13 | # methods. | ||||
14 | |||||
15 | package Foswiki::Prefs::HASH; | ||||
16 | |||||
17 | 2 | 26µs | 2 | 38µs | # spent 26µs (13+13) within Foswiki::Prefs::HASH::BEGIN@17 which was called:
# once (13µs+13µs) by Foswiki::Prefs::BEGIN@76 at line 17 # spent 26µs making 1 call to Foswiki::Prefs::HASH::BEGIN@17
# spent 13µs making 1 call to strict::import |
18 | 2 | 22µs | 2 | 17µs | # spent 13µs (9+4) within Foswiki::Prefs::HASH::BEGIN@18 which was called:
# once (9µs+4µs) by Foswiki::Prefs::BEGIN@76 at line 18 # spent 13µs making 1 call to Foswiki::Prefs::HASH::BEGIN@18
# spent 4µs making 1 call to warnings::import |
19 | |||||
20 | 2 | 125µs | 1 | 496µs | # spent 496µs (417+79) within Foswiki::Prefs::HASH::BEGIN@20 which was called:
# once (417µs+79µs) by Foswiki::Prefs::BEGIN@76 at line 20 # spent 496µs making 1 call to Foswiki::Prefs::HASH::BEGIN@20 |
21 | 1 | 7µs | our @ISA = qw(Foswiki::Prefs::BaseBackend); | ||
22 | |||||
23 | # spent 4µs within Foswiki::Prefs::HASH::BEGIN@23 which was called:
# once (4µs+0s) by Foswiki::Prefs::BEGIN@76 at line 28 | ||||
24 | 1 | 5µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
25 | require locale; | ||||
26 | import locale(); | ||||
27 | } | ||||
28 | 1 | 176µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::Prefs::HASH::BEGIN@23 |
29 | |||||
30 | # spent 154µs (122+32) within Foswiki::Prefs::HASH::new which was called 9 times, avg 17µs/call:
# 9 times (122µs+32µs) by Foswiki::Prefs::pushTopicContext at line 288 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 17µs/call | ||||
31 | 9 | 8µs | my ( $proto, $values ) = @_; | ||
32 | |||||
33 | 9 | 69µs | 9 | 32µs | my $this = $proto->SUPER::new(); # spent 32µs making 9 calls to Foswiki::Prefs::BaseBackend::new, avg 4µs/call |
34 | 9 | 16µs | while ( my ( $key, $value ) = each %$values ) { | ||
35 | $this->insert( 'Set', $key, $value ); | ||||
36 | } | ||||
37 | |||||
38 | 9 | 24µs | return $this; | ||
39 | } | ||||
40 | |||||
41 | 1 | 4µs | # spent 2µs within Foswiki::Prefs::HASH::finish which was called:
# once (2µs+0s) by Foswiki::Prefs::Stack::finish at line 72 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm | ||
42 | |||||
43 | # spent 17µs within Foswiki::Prefs::HASH::prefs which was called 9 times, avg 2µs/call:
# 9 times (17µs+0s) by Foswiki::Prefs::Stack::newLevel at line 199 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm, avg 2µs/call | ||||
44 | 9 | 3µs | my $this = shift; | ||
45 | 9 | 24µs | return keys %$this; | ||
46 | } | ||||
47 | |||||
48 | sub localPrefs { | ||||
49 | return (); | ||||
50 | } | ||||
51 | |||||
52 | # spent 24µs within Foswiki::Prefs::HASH::get which was called 11 times, avg 2µs/call:
# 9 times (15µs+0s) by Foswiki::Prefs::Stack::newLevel at line 205 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm, avg 2µs/call
# 2 times (8µs+0s) by Foswiki::Prefs::getPreference at line 455 of /var/www/foswikidev/core/lib/Foswiki/Prefs.pm, avg 4µs/call | ||||
53 | 11 | 7µs | my ( $this, $key ) = @_; | ||
54 | 11 | 33µs | return $this->{$key}; | ||
55 | } | ||||
56 | |||||
57 | sub getLocal { | ||||
58 | return; | ||||
59 | } | ||||
60 | |||||
61 | # spent 466µs (278+188) within Foswiki::Prefs::HASH::insert which was called 62 times, avg 8µs/call:
# 62 times (278µs+188µs) by Foswiki::Prefs::Stack::insert at line 171 of /var/www/foswikidev/core/lib/Foswiki/Prefs/Stack.pm, avg 8µs/call | ||||
62 | 62 | 37µs | my ( $this, $type, $key, $value ) = @_; | ||
63 | |||||
64 | 62 | 63µs | 62 | 188µs | $this->cleanupInsertValue( \$value ); # spent 188µs making 62 calls to Foswiki::Prefs::BaseBackend::cleanupInsertValue, avg 3µs/call |
65 | 62 | 45µs | $this->{$key} = $value; | ||
66 | 62 | 129µs | return 1; | ||
67 | } | ||||
68 | |||||
69 | 1 | 3µs | 1; | ||
70 | __END__ |