← Index
NYTProf Performance Profile   « line view »
For scripts/bench.pl
  Run on Mon Oct 22 16:48:56 2018
Reported on Mon Oct 22 16:49:10 2018

Filename/usr/lib/x86_64-linux-gnu/perl5/5.26/Scalar/Util.pm
StatementsExecuted 15 statements in 426µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
299611847µs847µsScalar::Util::::weakenScalar::Util::weaken (xsub)
99811246µs246µsScalar::Util::::unweakenScalar::Util::unweaken (xsub)
11113µs15µsScalar::Util::::BEGIN@9Scalar::Util::BEGIN@9
1117µs12µsScalar::Util::::BEGIN@10Scalar::Util::BEGIN@10
0000s0sScalar::Util::::export_failScalar::Util::export_fail
0000s0sScalar::Util::::set_prototypeScalar::Util::set_prototype
Call graph for these subroutines as a Graphviz dot language file.
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
7package Scalar::Util;
8
9228µs218µs
# spent 15µs (13+3) within Scalar::Util::BEGIN@9 which was called: # once (13µs+3µs) by Game::Collisions::AABB::BEGIN@30 at line 9
use strict;
# spent 15µs making 1 call to Scalar::Util::BEGIN@9 # spent 2µs making 1 call to strict::import
102339µs216µs
# spent 12µs (7+4) within Scalar::Util::BEGIN@10 which was called: # once (7µs+4µs) by Game::Collisions::AABB::BEGIN@30 at line 10
use warnings;
# spent 12µs making 1 call to Scalar::Util::BEGIN@10 # spent 4µs making 1 call to warnings::import
111500nsrequire Exporter;
12
1318µsour @ISA = qw(Exporter);
1412µsour @EXPORT_OK = qw(
15 blessed refaddr reftype weaken unweaken isweak
16
17 dualvar isdual isvstring looks_like_number openhandle readonly set_prototype
18 tainted
19);
201300nsour $VERSION = "1.50";
21115µs$VERSION = eval $VERSION;
# spent 3µs executing statements in string eval
22
231400nsrequire List::Util; # List::Util loads the XS
24121µs111µsList::Util->VERSION( $VERSION ); # Ensure we got the right XS version (RT#100863)
# spent 11µs making 1 call to UNIVERSAL::VERSION
25
26our @EXPORT_FAIL;
27
281600nsunless (defined &weaken) {
29 push @EXPORT_FAIL, qw(weaken);
30}
311100nsunless (defined &isweak) {
32 push @EXPORT_FAIL, qw(isweak isvstring);
33}
341100nsunless (defined &isvstring) {
35 push @EXPORT_FAIL, qw(isvstring);
36}
37
38sub export_fail {
39 if (grep { /^(?:weaken|isweak)$/ } @_ ) {
40 require Carp;
41 Carp::croak("Weak references are not implemented in the version of perl");
42 }
43
44 if (grep { /^isvstring$/ } @_ ) {
45 require Carp;
46 Carp::croak("Vstrings are not implemented in the version of perl");
47 }
48
49 @_;
50}
51
52# set_prototype has been moved to Sub::Util with a different interface
53sub set_prototype(&$)
54{
55 my ( $code, $proto ) = @_;
56 return Sub::Util::set_prototype( $proto, $code );
57}
58
59112µs1;
60
61__END__
 
# spent 246µs within Scalar::Util::unweaken which was called 998 times, avg 246ns/call: # 998 times (246µs+0s) by Game::Collisions::AABB::_set_node at line 181 of /home/tmurray/proj/Game-Collisions/lib/Game/Collisions/AABB.pm, avg 246ns/call
sub Scalar::Util::unweaken; # xsub
# spent 847µs within Scalar::Util::weaken which was called 2996 times, avg 283ns/call: # 2996 times (847µs+0s) by Game::Collisions::AABB::_set_node at line 184 of /home/tmurray/proj/Game-Collisions/lib/Game/Collisions/AABB.pm, avg 283ns/call
sub Scalar::Util::weaken; # xsub