Filename | /var/www/foswikidev/core/lib/Foswiki/Macros/VAR.pm |
Statements | Executed 102 statements in 313µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
12 | 1 | 1 | 169µs | 877µs | VAR | Foswiki::
1 | 1 | 1 | 16µs | 31µs | BEGIN@4.97 | Foswiki::
1 | 1 | 1 | 10µs | 15µs | BEGIN@5.98 | Foswiki::
1 | 1 | 1 | 4µs | 4µs | BEGIN@7.99 | Foswiki::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki; | ||||
3 | |||||
4 | 2 | 29µs | 2 | 46µs | # spent 31µs (16+15) within Foswiki::BEGIN@4.97 which was called:
# once (16µs+15µs) by Foswiki::_expandMacroOnTopicRendering at line 4 # spent 31µs making 1 call to Foswiki::BEGIN@4.97
# spent 15µs making 1 call to strict::import |
5 | 2 | 49µs | 2 | 20µs | # spent 15µs (10+5) within Foswiki::BEGIN@5.98 which was called:
# once (10µs+5µs) by Foswiki::_expandMacroOnTopicRendering at line 5 # spent 15µs making 1 call to Foswiki::BEGIN@5.98
# spent 5µs making 1 call to warnings::import |
6 | |||||
7 | # spent 4µs within Foswiki::BEGIN@7.99 which was called:
# once (4µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 12 | ||||
8 | 1 | 5µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
9 | require locale; | ||||
10 | import locale(); | ||||
11 | } | ||||
12 | 1 | 98µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::BEGIN@7.99 |
13 | |||||
14 | # spent 877µs (169+708) within Foswiki::VAR which was called 12 times, avg 73µs/call:
# 12 times (169µs+708µs) by Foswiki::_expandMacroOnTopicRendering at line 3435 of /var/www/foswikidev/core/lib/Foswiki.pm, avg 73µs/call | ||||
15 | 12 | 5µs | my ( $this, $params, $topicObject ) = @_; | ||
16 | 12 | 5µs | my $key = $params->{_DEFAULT}; | ||
17 | 12 | 1µs | return '' unless $key; | ||
18 | 12 | 4µs | my $web = $params->{web} || $topicObject->web; | ||
19 | 12 | 15µs | 12 | 19µs | my $topic = $topicObject->topic; # spent 19µs making 12 calls to Foswiki::Meta::topic, avg 2µs/call |
20 | |||||
21 | # handle %USERSWEB%-type cases | ||||
22 | 12 | 25µs | 12 | 58µs | ( $web, $topic ) = $this->normalizeWebTopicName( $web, $topic ); # spent 58µs making 12 calls to Foswiki::normalizeWebTopicName, avg 5µs/call |
23 | |||||
24 | 12 | 25µs | 12 | 117µs | my $webObject = Foswiki::Meta->new( $this, $web ); # spent 117µs making 12 calls to Foswiki::Meta::new, avg 10µs/call |
25 | |||||
26 | # always return a value, even when the key isn't defined | ||||
27 | 12 | 48µs | 12 | 514µs | return $webObject->getPreference($key) || ''; # spent 514µs making 12 calls to Foswiki::Meta::getPreference, avg 43µs/call |
28 | } | ||||
29 | |||||
30 | 1 | 2µs | 1; | ||
31 | __END__ |