← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:47 2015

Filename/usr/share/perl/5.20/overloading.pm
StatementsExecuted 14 statements in 382µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11119µs30µsoverloading::::BEGIN@2overloading::BEGIN@2
22117µs17µsoverloading::::unimportoverloading::unimport
0000s0soverloading::::_ops_to_numsoverloading::_ops_to_nums
0000s0soverloading::::importoverloading::import
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package overloading;
22342µs241µs
# spent 30µs (19+11) within overloading::BEGIN@2 which was called: # once (19µs+11µs) by overload::BEGIN@83 at line 2
use warnings;
# spent 30µs making 1 call to overloading::BEGIN@2 # spent 11µs making 1 call to warnings::import
3
41500nsour $VERSION = '0.02';
5
61300nsmy $HINT_NO_AMAGIC = 0x01000000; # see perl.h
7
8111µsrequire 5.010001;
9
10sub _ops_to_nums {
11 require overload::numbers;
12
13 map { exists $overload::numbers::names{"($_"}
14 ? $overload::numbers::names{"($_"}
15 : do { require Carp; Carp::croak("'$_' is not a valid overload") }
16 } @_;
17}
18
19sub import {
20 my ( $class, @ops ) = @_;
21
22 if ( @ops ) {
23 if ( $^H{overloading} ) {
24 vec($^H{overloading} , $_, 1) = 0 for _ops_to_nums(@ops);
25 }
26
27 if ( $^H{overloading} !~ /[^\0]/ ) {
28 delete $^H{overloading};
29 $^H &= ~$HINT_NO_AMAGIC;
30 }
31 } else {
32 delete $^H{overloading};
33 $^H &= ~$HINT_NO_AMAGIC;
34 }
35}
36
37
# spent 17µs within overloading::unimport which was called 2 times, avg 9µs/call: # once (10µs+0s) by overload::BEGIN@83 at line 83 of overload.pm # once (7µs+0s) by overload::BEGIN@114 at line 114 of overload.pm
sub unimport {
3822µs my ( $class, @ops ) = @_;
39
4025µs if ( exists $^H{overloading} or not $^H & $HINT_NO_AMAGIC ) {
41 if ( @ops ) {
42 vec($^H{overloading} ||= '', $_, 1) = 1 for _ops_to_nums(@ops);
43 } else {
4427µs delete $^H{overloading};
45 }
46 }
47
48211µs $^H |= $HINT_NO_AMAGIC;
49}
50
5114µs1;
52__END__