Filename | /Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/darwin-2level/Scalar/Util.pm |
Statements | Executed 14 statements in 271µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
410589 | 21 | 5 | 237ms | 237ms | refaddr (xsub) | Scalar::Util::
110696 | 8 | 4 | 94.8ms | 94.8ms | weaken (xsub) | Scalar::Util::
7724 | 9 | 9 | 5.43ms | 5.43ms | blessed (xsub) | Scalar::Util::
1 | 1 | 1 | 13µs | 25µs | BEGIN@9 | Scalar::Util::
6 | 1 | 1 | 12µs | 12µs | reftype (xsub) | Scalar::Util::
0 | 0 | 0 | 0s | 0s | export_fail | Scalar::Util::
0 | 0 | 0 | 0s | 0s | set_prototype | Scalar::Util::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # Copyright (c) 1997-2007 Graham Barr <gbarr@pobox.com>. All rights reserved. | ||||
2 | # This program is free software; you can redistribute it and/or | ||||
3 | # modify it under the same terms as Perl itself. | ||||
4 | # | ||||
5 | # Maintained since 2013 by Paul Evans <leonerd@leonerd.org.uk> | ||||
6 | |||||
7 | package Scalar::Util; | ||||
8 | |||||
9 | 2 | 224µs | 2 | 36µs | # spent 25µs (13+12) within Scalar::Util::BEGIN@9 which was called:
# once (13µs+12µs) by Perl::Critic::Utils::BEGIN@21 at line 9 # spent 25µs making 1 call to Scalar::Util::BEGIN@9
# spent 12µs making 1 call to strict::import |
10 | 1 | 300ns | require Exporter; | ||
11 | |||||
12 | 1 | 5µs | our @ISA = qw(Exporter); | ||
13 | 1 | 2µs | our @EXPORT_OK = qw( | ||
14 | blessed refaddr reftype weaken unweaken isweak | ||||
15 | |||||
16 | dualvar isdual isvstring looks_like_number openhandle readonly set_prototype | ||||
17 | tainted | ||||
18 | ); | ||||
19 | 1 | 200ns | our $VERSION = "1.42"; | ||
20 | 1 | 13µs | $VERSION = eval $VERSION; # spent 2µs executing statements in string eval | ||
21 | |||||
22 | 1 | 200ns | require List::Util; # List::Util loads the XS | ||
23 | 1 | 18µs | 1 | 10µs | List::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863) # spent 10µs making 1 call to UNIVERSAL::VERSION |
24 | |||||
25 | 1 | 100ns | our @EXPORT_FAIL; | ||
26 | |||||
27 | 1 | 400ns | unless (defined &weaken) { | ||
28 | push @EXPORT_FAIL, qw(weaken); | ||||
29 | } | ||||
30 | 1 | 200ns | unless (defined &isweak) { | ||
31 | push @EXPORT_FAIL, qw(isweak isvstring); | ||||
32 | } | ||||
33 | 1 | 100ns | unless (defined &isvstring) { | ||
34 | push @EXPORT_FAIL, qw(isvstring); | ||||
35 | } | ||||
36 | |||||
37 | sub export_fail { | ||||
38 | if (grep { /^(?:weaken|isweak)$/ } @_ ) { | ||||
39 | require Carp; | ||||
40 | Carp::croak("Weak references are not implemented in the version of perl"); | ||||
41 | } | ||||
42 | |||||
43 | if (grep { /^isvstring$/ } @_ ) { | ||||
44 | require Carp; | ||||
45 | Carp::croak("Vstrings are not implemented in the version of perl"); | ||||
46 | } | ||||
47 | |||||
48 | @_; | ||||
49 | } | ||||
50 | |||||
51 | # set_prototype has been moved to Sub::Util with a different interface | ||||
52 | sub set_prototype(&$) | ||||
53 | { | ||||
54 | my ( $code, $proto ) = @_; | ||||
55 | return Sub::Util::set_prototype( $proto, $code ); | ||||
56 | } | ||||
57 | |||||
58 | 1 | 7µs | 1; | ||
59 | |||||
60 | __END__ | ||||
# spent 5.43ms within Scalar::Util::blessed which was called 7724 times, avg 703ns/call:
# 6775 times (4.59ms+0s) by Devel::StackTrace::_ref_to_string at line 81 of Devel/StackTrace.pm, avg 677ns/call
# 236 times (108µs+0s) by Path::IsDev::Role::Heuristic::name at line 12 of Path/IsDev/Role/Heuristic.pm, avg 459ns/call
# 154 times (162µs+0s) by Perl::Critic::Utils::_name_for_sub_or_stringified_element at line 352 of Perl/Critic/Utils.pm, avg 1µs/call
# 144 times (212µs+0s) by Perl::Critic::critique at line 104 of Perl/Critic.pm, avg 1µs/call
# 144 times (119µs+0s) by Perl::Critic::Document::_is_ppi_doc at line 135 of Perl/Critic/Document.pm, avg 828ns/call
# 142 times (162µs+0s) by Perl::Critic::Policy::TestingAndDebugging::RequireUseStrict::__ANON__[/Users/timbo/perl5/perlbrew/perls/perl-5.18.2/lib/site_perl/5.18.2/Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm:116] at line 105 of Perl/Critic/Policy/TestingAndDebugging/RequireUseStrict.pm, avg 1µs/call
# 104 times (48µs+0s) by Path::IsDev::Role::NegativeHeuristic::name at line 12 of Path/IsDev/Role/NegativeHeuristic.pm, avg 460ns/call
# 22 times (32µs+0s) by Perl::Critic::Config::add_policy at line 175 of Perl/Critic/Config.pm, avg 1µs/call
# 3 times (4µs+0s) by Perl::Critic::Violation::new at line 83 of Perl/Critic/Violation.pm, avg 2µs/call | |||||
# spent 237ms within Scalar::Util::refaddr which was called 410589 times, avg 576ns/call:
# 95278 times (47.5ms+0s) by List::MoreUtils::firstidx at line 368 of PPI/Element.pm, avg 498ns/call
# 94372 times (51.4ms+0s) by PPI::Element::DESTROY at line 1083 of PPI/Element.pm, avg 544ns/call
# 50565 times (32.4ms+0s) by PPI::Lexer::_add_element at line 1462 of PPI/Lexer.pm, avg 641ns/call
# 30261 times (17.5ms+0s) by PPI::Element::snext_sibling at line 364 of PPI/Element.pm, avg 578ns/call
# 30261 times (17.3ms+0s) by PPI::Element::snext_sibling at line 365 of PPI/Element.pm, avg 570ns/call
# 23725 times (12.8ms+0s) by PPI::Element::parent at line 147 of PPI/Element.pm, avg 539ns/call
# 18723 times (13.3ms+0s) by PPI::Lexer::_add_delayed at line 1478 of PPI/Lexer.pm, avg 708ns/call
# 18659 times (13.3ms+0s) by PPI::Lexer::_add_element at line 1456 of PPI/Lexer.pm, avg 714ns/call
# 16471 times (9.49ms+0s) by PPI::Node::DESTROY at line 709 of PPI/Node.pm, avg 576ns/call
# 10451 times (7.47ms+0s) by PPI::Statement::new at line 205 of PPI/Statement.pm, avg 715ns/call
# 5789 times (4.95ms+0s) by PPI::Structure::new at line 132 of PPI/Structure.pm, avg 854ns/call
# 5789 times (4.38ms+0s) by PPI::Lexer::_lex_structure at line 1360 of PPI/Lexer.pm, avg 756ns/call
# 5789 times (2.49ms+0s) by List::MoreUtils::firstidx at line 345 of PPI/Element.pm, avg 430ns/call
# 2437 times (1.13ms+0s) by List::MoreUtils::firstidx at line 416 of PPI/Element.pm, avg 464ns/call
# 576 times (459µs+0s) by PPI::Lexer::_lex_end at line 677 of PPI/Lexer.pm, avg 796ns/call
# 339 times (192µs+0s) by PPI::Element::sprevious_sibling at line 413 of PPI/Element.pm, avg 567ns/call
# 339 times (176µs+0s) by PPI::Element::sprevious_sibling at line 412 of PPI/Element.pm, avg 519ns/call
# 286 times (174µs+0s) by PPI::Element::statement at line 284 of PPI/Element.pm, avg 607ns/call
# 226 times (123µs+0s) by PPI::Element::next_sibling at line 342 of PPI/Element.pm, avg 545ns/call
# 226 times (121µs+0s) by PPI::Element::next_sibling at line 341 of PPI/Element.pm, avg 535ns/call
# 27 times (14µs+0s) by PPI::Element::top at line 306 of PPI/Element.pm, avg 519ns/call | |||||
# spent 12µs within Scalar::Util::reftype which was called 6 times, avg 2µs/call:
# 6 times (12µs+0s) by Sub::Install::_CODELIKE at line 23 of Sub/Install.pm, avg 2µs/call | |||||
# spent 94.8ms within Scalar::Util::weaken which was called 110696 times, avg 856ns/call:
# 50565 times (40.1ms+0s) by PPI::Lexer::_add_element at line 1462 of PPI/Lexer.pm, avg 793ns/call
# 18723 times (15.7ms+0s) by PPI::Lexer::_add_delayed at line 1478 of PPI/Lexer.pm, avg 836ns/call
# 18659 times (14.3ms+0s) by PPI::Lexer::_add_element at line 1456 of PPI/Lexer.pm, avg 768ns/call
# 10451 times (11.9ms+0s) by PPI::Statement::new at line 205 of PPI/Statement.pm, avg 1µs/call
# 5789 times (6.88ms+0s) by PPI::Structure::new at line 132 of PPI/Structure.pm, avg 1µs/call
# 5789 times (4.99ms+0s) by PPI::Lexer::_lex_structure at line 1360 of PPI/Lexer.pm, avg 862ns/call
# 576 times (497µs+0s) by PPI::Lexer::_lex_end at line 677 of PPI/Lexer.pm, avg 863ns/call
# 144 times (422µs+0s) by Perl::Critic::Document::find at line 176 of Perl/Critic/Document.pm, avg 3µs/call |