Filename | /var/www/foswiki11/lib/Foswiki/Prefs/HASH.pm |
Statements | Executed 261 statements in 898µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 387µs | 451µs | BEGIN@20 | Foswiki::Prefs::HASH::
48 | 1 | 1 | 354µs | 538µs | insert | Foswiki::Prefs::HASH::
7 | 1 | 1 | 151µs | 188µs | new | Foswiki::Prefs::HASH::
9 | 2 | 2 | 32µs | 32µs | get | Foswiki::Prefs::HASH::
7 | 1 | 1 | 18µs | 18µs | prefs | Foswiki::Prefs::HASH::
1 | 1 | 1 | 13µs | 29µs | BEGIN@17 | Foswiki::Prefs::HASH::
1 | 1 | 1 | 9µs | 14µs | BEGIN@18 | 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 | 27µs | 2 | 45µs | # spent 29µs (13+16) within Foswiki::Prefs::HASH::BEGIN@17 which was called:
# once (13µs+16µs) by Foswiki::Prefs::BEGIN@69 at line 17 # spent 29µs making 1 call to Foswiki::Prefs::HASH::BEGIN@17
# spent 16µs making 1 call to strict::import |
18 | 2 | 23µs | 2 | 20µs | # spent 14µs (9+5) within Foswiki::Prefs::HASH::BEGIN@18 which was called:
# once (9µs+5µs) by Foswiki::Prefs::BEGIN@69 at line 18 # spent 14µs making 1 call to Foswiki::Prefs::HASH::BEGIN@18
# spent 5µs making 1 call to warnings::import |
19 | |||||
20 | 2 | 282µs | 1 | 451µs | # spent 451µs (387+63) within Foswiki::Prefs::HASH::BEGIN@20 which was called:
# once (387µs+63µs) by Foswiki::Prefs::BEGIN@69 at line 20 # spent 451µs making 1 call to Foswiki::Prefs::HASH::BEGIN@20 |
21 | 1 | 8µs | our @ISA = qw(Foswiki::Prefs::BaseBackend); | ||
22 | |||||
23 | # spent 188µs (151+37) within Foswiki::Prefs::HASH::new which was called 7 times, avg 27µs/call:
# 7 times (151µs+37µs) by Foswiki::Prefs::pushTopicContext at line 283 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 27µs/call | ||||
24 | 7 | 10µs | my ( $proto, $values ) = @_; | ||
25 | |||||
26 | 7 | 90µs | 7 | 37µs | my $this = $proto->SUPER::new(); # spent 37µs making 7 calls to Foswiki::Prefs::BaseBackend::new, avg 5µs/call |
27 | 7 | 16µs | while ( my ( $key, $value ) = each %$values ) { | ||
28 | $this->insert( 'Set', $key, $value ); | ||||
29 | } | ||||
30 | |||||
31 | 7 | 31µs | return $this; | ||
32 | } | ||||
33 | |||||
34 | 1 | 6µs | # spent 2µs within Foswiki::Prefs::HASH::finish which was called:
# once (2µs+0s) by Foswiki::Prefs::Stack::finish at line 65 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm | ||
35 | |||||
36 | # spent 18µs within Foswiki::Prefs::HASH::prefs which was called 7 times, avg 3µs/call:
# 7 times (18µs+0s) by Foswiki::Prefs::Stack::newLevel at line 192 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm, avg 3µs/call | ||||
37 | 7 | 3µs | my $this = shift; | ||
38 | 7 | 27µs | return keys %$this; | ||
39 | } | ||||
40 | |||||
41 | sub localPrefs { | ||||
42 | return (); | ||||
43 | } | ||||
44 | |||||
45 | # spent 32µs within Foswiki::Prefs::HASH::get which was called 9 times, avg 4µs/call:
# 7 times (24µs+0s) by Foswiki::Prefs::Stack::newLevel at line 198 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm, avg 3µs/call
# 2 times (8µs+0s) by Foswiki::Prefs::getPreference at line 450 of /var/www/foswiki11/lib/Foswiki/Prefs.pm, avg 4µs/call | ||||
46 | 9 | 9µs | my ( $this, $key ) = @_; | ||
47 | 9 | 31µs | return $this->{$key}; | ||
48 | } | ||||
49 | |||||
50 | sub getLocal { | ||||
51 | return; | ||||
52 | } | ||||
53 | |||||
54 | # spent 538µs (354+184) within Foswiki::Prefs::HASH::insert which was called 48 times, avg 11µs/call:
# 48 times (354µs+184µs) by Foswiki::Prefs::Stack::insert at line 164 of /var/www/foswiki11/lib/Foswiki/Prefs/Stack.pm, avg 11µs/call | ||||
55 | 48 | 53µs | my ( $this, $type, $key, $value ) = @_; | ||
56 | |||||
57 | 48 | 85µs | 48 | 184µs | $this->cleanupInsertValue( \$value ); # spent 184µs making 48 calls to Foswiki::Prefs::BaseBackend::cleanupInsertValue, avg 4µs/call |
58 | 48 | 55µs | $this->{$key} = $value; | ||
59 | 48 | 139µs | return 1; | ||
60 | } | ||||
61 | |||||
62 | 1 | 3µs | 1; | ||
63 | __END__ |