← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/hailo
  Run on Thu Oct 21 22:50:37 2010
Reported on Thu Oct 21 22:52:07 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/x86_64-linux/Scalar/Util.pm
StatementsExecuted 27 statements in 625µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
807631.24ms1.24msScalar::Util::::reftypeScalar::Util::reftype (xsub)
12765190µs190µsScalar::Util::::blessedScalar::Util::blessed (xsub)
7344141µs141µsScalar::Util::::weakenScalar::Util::weaken (xsub)
31165µs77µsScalar::Util::::openhandleScalar::Util::openhandle
11127µs33µsScalar::Util::::BEGIN@9Scalar::Util::BEGIN@9
11115µs130µsScalar::Util::::BEGIN@10Scalar::Util::BEGIN@10
2118µs8µsScalar::Util::::refaddrScalar::Util::refaddr (xsub)
0000s0sScalar::Util::::export_failScalar::Util::export_fail
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
9230µs238µs
# spent 33µs (27+5) within Scalar::Util::BEGIN@9 which was called: # once (27µs+5µs) by Mouse::Util::BEGIN@81 at line 9
use strict;
# spent 33µs making 1 call to Scalar::Util::BEGIN@9 # spent 5µs making 1 call to strict::import
102337µs2245µs
# spent 130µs (15+115) within Scalar::Util::BEGIN@10 which was called: # once (15µs+115µs) by Mouse::Util::BEGIN@81 at line 10
use vars qw(@ISA @EXPORT_OK $VERSION @EXPORT_FAIL);
# spent 130µs making 1 call to Scalar::Util::BEGIN@10 # spent 115µs making 1 call to vars::import
1112µsrequire Exporter;
121139µsrequire List::Util; # List::Util loads the XS
13
1416µs@ISA = qw(Exporter);
1513µs@EXPORT_OK = qw(blessed dualvar reftype weaken isweak tainted readonly openhandle refaddr isvstring looks_like_number set_prototype);
1611µs$VERSION = "1.23";
17120µs$VERSION = eval $VERSION;
# spent 3µs executing statements in string eval
18
1911µ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
48
# spent 77µs (65+12) within Scalar::Util::openhandle which was called 3 times, avg 26µs/call: # 3 times (65µs+12µs) by IO::Interactive::is_interactive at line 17 of IO/Interactive.pm, avg 26µs/call
sub openhandle ($) {
491579µs my $fh = shift;
5036µs my $rt = reftype($fh) || '';
# spent 6µs making 3 calls to Scalar::Util::reftype, avg 2µs/call
51
52 return defined(fileno($fh)) ? $fh : undef
53 if $rt eq 'IO';
54
5536µs if (reftype(\$fh) eq 'GLOB') { # handle openhandle(*DATA)
# spent 6µs making 3 calls to Scalar::Util::reftype, avg 2µs/call
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
6618µs1;
67
68__END__
 
# spent 190µs within Scalar::Util::blessed which was called 127 times, avg 1µs/call: # 68 times (98µs+0s) by Mouse::Meta::Class::add_attribute at line 205 of Mouse/Meta/Class.pm, avg 1µs/call # 22 times (35µs+0s) by MouseX::Getopt::OptionTypeMap::has_option_type at line 25 of MouseX/Getopt/OptionTypeMap.pm, avg 2µs/call # 22 times (31µs+0s) by MouseX::Getopt::OptionTypeMap::get_option_type at line 43 of MouseX/Getopt/OptionTypeMap.pm, avg 1µs/call # 11 times (17µs+0s) by Mouse::Util::apply_all_roles at line 276 of Mouse/Util.pm, avg 2µs/call # 3 times (6µs+0s) by Mouse::Util::TypeConstraints::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux/Mouse/Util/TypeConstraints.pm:217] at line 215 of Mouse/Util/TypeConstraints.pm, avg 2µs/call # once (4µs+0s) by Hailo::DEMOLISH at line 334 of lib/Hailo.pm
sub Scalar::Util::blessed; # xsub
# spent 8µs within Scalar::Util::refaddr which was called 2 times, avg 4µs/call: # 2 times (8µs+0s) by Tie::RefHash::STORE at line 211 of Tie/RefHash.pm, avg 4µs/call
sub Scalar::Util::refaddr; # xsub
# spent 1.24ms within Scalar::Util::reftype which was called 807 times, avg 2µs/call: # 655 times (1.01ms+0s) by Package::Stash::has_package_symbol at line 134 of Package/Stash.pm, avg 2µs/call # 131 times (187µs+0s) by Package::Stash::_valid_for_type at line 74 of Package/Stash.pm, avg 1µs/call # 9 times (20µs+0s) by Package::Stash::_valid_for_type at line 69 of Package/Stash.pm, avg 2µs/call # 6 times (12µs+0s) by Sub::Install::_CODELIKE at line 98 of Sub/Install.pm, avg 2µs/call # 3 times (6µs+0s) by Scalar::Util::openhandle at line 50, avg 2µs/call # 3 times (6µs+0s) by Scalar::Util::openhandle at line 55, avg 2µs/call
sub Scalar::Util::reftype; # xsub
# spent 141µs within Scalar::Util::weaken which was called 73 times, avg 2µs/call: # 68 times (128µs+0s) by Mouse::Meta::Class::add_attribute at line 236 of Mouse/Meta/Class.pm, avg 2µs/call # 3 times (7µs+0s) by Mouse::Meta::Module::create at line 231 of Mouse/Meta/Module.pm, avg 2µs/call # once (4µs+0s) by Hailo::Storage::BEGIN@6 at line 292 of DBI.pm # once (2µs+0s) by Hailo::__ANON__[lib/Hailo.pm:170] at line 142 of lib/Hailo.pm
sub Scalar::Util::weaken; # xsub