← Index
NYTProf Performance Profile   « line view »
For ./view
  Run on Fri Jul 31 18:42:36 2015
Reported on Fri Jul 31 18:48:13 2015

Filename/var/www/foswikidev/core/lib/Assert.pm
StatementsExecuted 13 statements in 571µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.70ms2.17msAssert::::BEGIN@16Assert::BEGIN@16
11123µs47µsAssert::::BEGIN@8Assert::BEGIN@8
11117µs37µsAssert::::BEGIN@13Assert::BEGIN@13
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# See bottom of file for license and copyright information
2package Assert;
3
4# Significant performance gains are delivered by exporting a constant
5# DEBUG to the calling module rather than an subroutine, which the perl
6# optimiser fails to see as a constant.
7
8279µs271µs
# spent 47µs (23+24) within Assert::BEGIN@8 which was called: # once (23µs+24µs) by Foswiki::BEGIN@46 at line 8
use strict;
# spent 47µs making 1 call to Assert::BEGIN@8 # spent 24µs making 1 call to strict::import
9
1011µsour $VERSION = "1.200";
11129µs$VERSION = eval $VERSION;
# spent 4µs executing statements in string eval
12
13290µs258µs
# spent 37µs (17+20) within Assert::BEGIN@13 which was called: # once (17µs+20µs) by Foswiki::BEGIN@46 at line 13
use Exporter;
# spent 37µs making 1 call to Assert::BEGIN@13 # spent 20µs making 1 call to Exporter::import
14112µsour @ISA = ('Exporter');
15
162259µs22.24ms
# spent 2.17ms (1.70+472µs) within Assert::BEGIN@16 which was called: # once (1.70ms+472µs) by Foswiki::BEGIN@46 at line 16
use constant DEBUG => ( $ENV{FOSWIKI_ASSERTS} ) ? 1 : 0;
# spent 2.17ms making 1 call to Assert::BEGIN@16 # spent 66µs making 1 call to constant::import
1712µsour @EXPORT = qw(ASSERT UNTAINTED TAINT DEBUG);
18
191500nsour $soft = 0;
20
21# Easier than farting about with AUTOLOAD; pull in the implementation we want,
22# either AssertOn or AssertOff
23190µsrequire 'Assert' . ( DEBUG ? 'On' : 'Off' ) . '.pm';
24
25=begin TML
26---++ DEBUG
27Constant indicating whether asserts are currently active. This constant is
28set at the start of the program run from the environment variable
29FOSWIKI_ASSERTS.
30
31---++ ASSERT(condition [, message]) if DEBUG
32Assert that =condition= returns true. =message= is used to generate a 'friendly'
33error message if it is provided. The =if DEBUG= is required to give the perl
34optimiser a chance to eliminate this function call if asserts are not enabled.
35
36---++ TAINT($val) -> $var
37Generate a tainted version of the variable with the same value.
38
39---++ UNTAINTED($val) -> $boolean
40Return true if the vaue passed is untainted.
41
42=cut
43
4418µs1;
45__END__