← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/local/src/github.com/foswiki/core/bin/view
  Run on Sun Dec 4 17:17:59 2011
Reported on Sun Dec 4 17:26:32 2011

Filename/usr/lib/perl/5.14/Scalar/Util.pm
StatementsExecuted 12 statements in 819µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2201324.86ms4.86msScalar::Util::::taintedScalar::Util::tainted (xsub)
262255µs55µsScalar::Util::::reftypeScalar::Util::reftype (xsub)
263254µs54µsScalar::Util::::blessedScalar::Util::blessed (xsub)
252247µs47µsScalar::Util::::refaddrScalar::Util::refaddr (xsub)
11139µs175µsScalar::Util::::BEGIN@10Scalar::Util::BEGIN@10
11124µs31µsScalar::Util::::BEGIN@9Scalar::Util::BEGIN@9
0000s0sScalar::Util::::export_failScalar::Util::export_fail
0000s0sScalar::Util::::openhandleScalar::Util::openhandle
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1# Scalar::Util.pm
2#
3# Copyright (c) 1997-2007 Graham Barr <gbarr@pobox.com>. All rights reserved.
4# This program is free software; you can redistribute it and/or
5# modify it under the same terms as Perl itself.
6
7package Scalar::Util;
8
9249µs238µs
# spent 31µs (24+7) within Scalar::Util::BEGIN@9 which was called: # once (24µs+7µs) by Error::BEGIN@46 at line 9
use strict;
# spent 31µs making 1 call to Scalar::Util::BEGIN@9 # spent 7µs making 1 call to strict::import
102594µs2311µs
# spent 175µs (39+136) within Scalar::Util::BEGIN@10 which was called: # once (39µs+136µs) by Error::BEGIN@46 at line 10
use vars qw(@ISA @EXPORT_OK $VERSION @EXPORT_FAIL);
# spent 175µs making 1 call to Scalar::Util::BEGIN@10 # spent 136µs making 1 call to vars::import
1112µsrequire Exporter;
121117µsrequire List::Util; # List::Util loads the XS
13
1417µs@ISA = qw(Exporter);
1514µs@EXPORT_OK = qw(blessed dualvar reftype weaken isweak tainted readonly openhandle refaddr isvstring looks_like_number set_prototype);
1611µs$VERSION = "1.23";
17131µs$VERSION = eval $VERSION;
# spent 4µs executing statements in string eval
18
1912µsunless (defined &dualvar) {
20 # Load Pure Perl version if XS not loaded
21 require Scalar::Util::PP;
22 Scalar::Util::PP->import;
23 push @EXPORT_FAIL, qw(weaken isweak dualvar isvstring set_prototype);
24}
25
26sub export_fail {
27 if (grep { /dualvar/ } @EXPORT_FAIL) { # no XS loaded
28 my $pat = join("|", @EXPORT_FAIL);
29 if (my ($err) = grep { /^($pat)$/ } @_ ) {
30 require Carp;
31 Carp::croak("$err is only available with the XS version of Scalar::Util");
32 }
33 }
34
35 if (grep { /^(weaken|isweak)$/ } @_ ) {
36 require Carp;
37 Carp::croak("Weak references are not implemented in the version of perl");
38 }
39
40 if (grep { /^(isvstring)$/ } @_ ) {
41 require Carp;
42 Carp::croak("Vstrings are not implemented in the version of perl");
43 }
44
45 @_;
46}
47
48sub openhandle ($) {
49 my $fh = shift;
50 my $rt = reftype($fh) || '';
51
52 return defined(fileno($fh)) ? $fh : undef
53 if $rt eq 'IO';
54
55 if (reftype(\$fh) eq 'GLOB') { # handle openhandle(*DATA)
56 $fh = \(my $tmp=$fh);
57 }
58 elsif ($rt ne 'GLOB') {
59 return undef;
60 }
61
62 (tied(*$fh) or defined(fileno($fh)))
63 ? $fh : undef;
64}
65
66112µs1;
67
68__END__
 
# spent 54µs within Scalar::Util::blessed which was called 26 times, avg 2µs/call: # 23 times (38µs+0s) by CGI::Session::Serialize::default::__scan at line 79 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Serialize/default.pm, avg 2µs/call # 2 times (7µs+0s) by Foswiki::Engine::finalizeCookies at line 379 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Engine.pm, avg 4µs/call # once (10µs+0s) by Foswiki::Engine::finalizeBody at line 399 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Engine.pm
sub Scalar::Util::blessed; # xsub
# spent 47µs within Scalar::Util::refaddr which was called 25 times, avg 2µs/call: # 22 times (40µs+0s) by CGI::Session::Serialize::default::__walk at line 57 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Serialize/default.pm, avg 2µs/call # 3 times (7µs+0s) by Safe::_find_code_refs at line 385 of Safe.pm, avg 2µs/call
sub Scalar::Util::refaddr; # xsub
# spent 55µs within Scalar::Util::reftype which was called 26 times, avg 2µs/call: # 22 times (47µs+0s) by Safe::_find_code_refs at line 381 of Safe.pm, avg 2µs/call # 4 times (8µs+0s) by CGI::Session::Serialize::default::__walk at line 59 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Serialize/default.pm, avg 2µs/call
sub Scalar::Util::reftype; # xsub
# spent 4.86ms within Scalar::Util::tainted which was called 2201 times, avg 2µs/call: # 1099 times (2.90ms+0s) by Foswiki::Func::_checkWTA at line 78 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Func.pm, avg 3µs/call # 1099 times (1.95ms+0s) by Foswiki::Func::_checkWTA at line 84 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Func.pm, avg 2µs/call # 3 times (10µs+0s) by Foswiki::Users::TopicUserMapping::eachGroupMember at line 605 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Users/TopicUserMapping.pm, avg 3µs/call
sub Scalar::Util::tainted; # xsub