Filename | /var/www/foswikidev/core/lib/Foswiki/Macros/REVINFO.pm |
Statements | Executed 51 statements in 376µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 154µs | 48.4ms | REVINFO | Foswiki::
1 | 1 | 1 | 13µs | 26µs | BEGIN@4.80 | Foswiki::
1 | 1 | 1 | 9µs | 14µs | BEGIN@5.81 | Foswiki::
1 | 1 | 1 | 4µs | 4µs | BEGIN@7.82 | 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 | 31µs | 2 | 38µs | # spent 26µs (13+12) within Foswiki::BEGIN@4.80 which was called:
# once (13µs+12µs) by Foswiki::_expandMacroOnTopicRendering at line 4 # spent 26µs making 1 call to Foswiki::BEGIN@4.80
# spent 12µs making 1 call to strict::import |
5 | 2 | 47µs | 2 | 18µs | # spent 14µs (9+4) within Foswiki::BEGIN@5.81 which was called:
# once (9µs+4µs) by Foswiki::_expandMacroOnTopicRendering at line 5 # spent 14µs making 1 call to Foswiki::BEGIN@5.81
# spent 4µs making 1 call to warnings::import |
6 | |||||
7 | # spent 4µs within Foswiki::BEGIN@7.82 which was called:
# once (4µs+0s) by Foswiki::_expandMacroOnTopicRendering at line 12 | ||||
8 | 1 | 4µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
9 | require locale; | ||||
10 | import locale(); | ||||
11 | } | ||||
12 | 1 | 186µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::BEGIN@7.82 |
13 | |||||
14 | #| $web | web and | | ||||
15 | #| $topic | topic to display the name for | | ||||
16 | #| $formatString | format string (like in search) | | ||||
17 | # spent 48.4ms (154µs+48.2) within Foswiki::REVINFO which was called 3 times, avg 16.1ms/call:
# 3 times (154µs+48.2ms) by Foswiki::_expandMacroOnTopicRendering at line 3435 of /var/www/foswikidev/core/lib/Foswiki.pm, avg 16.1ms/call | ||||
18 | 3 | 3µs | my ( $this, $params, $topicObject ) = @_; | ||
19 | 3 | 4µs | my $format = $params->{_DEFAULT} || $params->{format}; | ||
20 | 3 | 6µs | 3 | 5µs | my $web = $params->{web} || $topicObject->web; # spent 5µs making 3 calls to Foswiki::Meta::web, avg 2µs/call |
21 | 3 | 5µs | 3 | 5µs | my $topic = $params->{topic} || $topicObject->topic; # spent 5µs making 3 calls to Foswiki::Meta::topic, avg 2µs/call |
22 | 3 | 1µs | my $cgiQuery = $this->{request}; | ||
23 | 3 | 1µs | my $cgiRev = ''; | ||
24 | 3 | 5µs | 3 | 50µs | $cgiRev = $cgiQuery->param('rev') if ($cgiQuery); # spent 50µs making 3 calls to Foswiki::Request::param, avg 16µs/call |
25 | 3 | 6µs | 3 | 7µs | my $rev = Foswiki::Store::cleanUpRevID( $params->{rev} || $cgiRev || '' ); # spent 7µs making 3 calls to Foswiki::Store::cleanUpRevID, avg 2µs/call |
26 | |||||
27 | 3 | 8µs | 3 | 18µs | ( $web, $topic ) = $this->normalizeWebTopicName( $web, $topic ); # spent 18µs making 3 calls to Foswiki::normalizeWebTopicName, avg 6µs/call |
28 | 3 | 6µs | 3 | 5µs | my $loadedRev = $topicObject->getLoadedRev(); # spent 5µs making 3 calls to Foswiki::Meta::getLoadedRev, avg 2µs/call |
29 | 3 | 12µs | 6 | 9µs | if ( $web ne $topicObject->web # spent 5µs making 3 calls to Foswiki::Meta::web, avg 2µs/call
# spent 4µs making 3 calls to Foswiki::Meta::topic, avg 1µs/call |
30 | || $topic ne $topicObject->topic | ||||
31 | || !defined($loadedRev) | ||||
32 | || $loadedRev ne $rev ) | ||||
33 | { | ||||
34 | 3 | 9µs | 3 | 33µs | $topicObject = Foswiki::Meta->new( $this, $web, $topic ); # spent 33µs making 3 calls to Foswiki::Meta::new, avg 11µs/call |
35 | |||||
36 | # haveAccess will try to load the object on the fly, so make sure | ||||
37 | # it is loaded if rev is defined | ||||
38 | 3 | 700ns | $topicObject = $topicObject->load($rev) if ($rev); | ||
39 | 3 | 8µs | 3 | 117µs | unless ( $topicObject->haveAccess('VIEW') ) { # spent 117µs making 3 calls to Foswiki::Meta::haveAccess, avg 39µs/call |
40 | return $this->inlineAlert( 'alerts', 'access_denied', $web, | ||||
41 | $topic ); | ||||
42 | } | ||||
43 | } | ||||
44 | |||||
45 | 3 | 30µs | 6 | 48.0ms | return $this->renderer->renderRevisionInfo( $topicObject, $rev, $format ); # spent 48.0ms making 3 calls to Foswiki::Render::renderRevisionInfo, avg 16.0ms/call
# spent 6µs making 3 calls to Foswiki::renderer, avg 2µs/call |
46 | } | ||||
47 | |||||
48 | 1 | 2µs | 1; | ||
49 | __END__ |