← Index
NYTProf Performance Profile   « line view »
For split.pl
  Run on Thu Apr 20 02:05:47 2023
Reported on Thu Apr 20 18:31:09 2023

Filename/usr/lib/x86_64-linux-gnu/perl-base/Tie/Hash.pm
StatementsExecuted 7 statements in 392µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs32µsTie::Hash::::BEGIN@5 Tie::Hash::BEGIN@5
1114µs22µsTie::Hash::::BEGIN@6 Tie::Hash::BEGIN@6
1111µs1µsTie::StdHash::::TIEHASH Tie::StdHash::TIEHASH
0000s0sTie::ExtraHash::::CLEARTie::ExtraHash::CLEAR
0000s0sTie::ExtraHash::::DELETETie::ExtraHash::DELETE
0000s0sTie::ExtraHash::::EXISTSTie::ExtraHash::EXISTS
0000s0sTie::ExtraHash::::FETCHTie::ExtraHash::FETCH
0000s0sTie::ExtraHash::::FIRSTKEYTie::ExtraHash::FIRSTKEY
0000s0sTie::ExtraHash::::NEXTKEYTie::ExtraHash::NEXTKEY
0000s0sTie::ExtraHash::::SCALARTie::ExtraHash::SCALAR
0000s0sTie::ExtraHash::::STORETie::ExtraHash::STORE
0000s0sTie::ExtraHash::::TIEHASHTie::ExtraHash::TIEHASH
0000s0sTie::Hash::::CLEAR Tie::Hash::CLEAR
0000s0sTie::Hash::::EXISTS Tie::Hash::EXISTS
0000s0sTie::Hash::::TIEHASH Tie::Hash::TIEHASH
0000s0sTie::Hash::::new Tie::Hash::new
0000s0sTie::StdHash::::CLEAR Tie::StdHash::CLEAR
0000s0sTie::StdHash::::DELETE Tie::StdHash::DELETE
0000s0sTie::StdHash::::EXISTS Tie::StdHash::EXISTS
0000s0sTie::StdHash::::FETCH Tie::StdHash::FETCH
0000s0sTie::StdHash::::FIRSTKEY Tie::StdHash::FIRSTKEY
0000s0sTie::StdHash::::NEXTKEY Tie::StdHash::NEXTKEY
0000s0sTie::StdHash::::SCALAR Tie::StdHash::SCALAR
0000s0sTie::StdHash::::STORE Tie::StdHash::STORE
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Tie::Hash;
2
31200nsour $VERSION = '1.06';
4
5218µs254µs
# spent 32µs (9+23) within Tie::Hash::BEGIN@5 which was called: # once (9µs+23µs) by File::Slurp::BEGIN@16 at line 5
use Carp;
# spent 32µs making 1 call to Tie::Hash::BEGIN@5 # spent 23µs making 1 call to Exporter::import
62368µs240µs
# spent 22µs (4+18) within Tie::Hash::BEGIN@6 which was called: # once (4µs+18µs) by File::Slurp::BEGIN@16 at line 6
use warnings::register;
# spent 22µs making 1 call to Tie::Hash::BEGIN@6 # spent 18µs making 1 call to warnings::register::import
7
8sub new {
9 my $pkg = shift;
10 $pkg->TIEHASH(@_);
11}
12
13# Legacy support for new()
14
15sub TIEHASH {
16 my $pkg = shift;
17 my $pkg_new = $pkg -> can ('new');
18
19 if ($pkg_new and $pkg ne __PACKAGE__) {
20 my $my_new = __PACKAGE__ -> can ('new');
21 if ($pkg_new == $my_new) {
22 #
23 # Prevent recursion
24 #
25 croak "$pkg must define either a TIEHASH() or a new() method";
26 }
27
28 warnings::warnif ("WARNING: calling ${pkg}->new since " .
29 "${pkg}->TIEHASH is missing");
30 $pkg -> new (@_);
31 }
32 else {
33 croak "$pkg doesn't define a TIEHASH method";
34 }
35}
36
37sub EXISTS {
38 my $pkg = ref $_[0];
39 croak "$pkg doesn't define an EXISTS method";
40}
41
42sub CLEAR {
43 my $self = shift;
44 my $key = $self->FIRSTKEY(@_);
45 my @keys;
46
47 while (defined $key) {
48 push @keys, $key;
49 $key = $self->NEXTKEY(@_, $key);
50 }
51 foreach $key (@keys) {
52 $self->DELETE(@_, $key);
53 }
54}
55
56# The Tie::StdHash package implements standard perl hash behaviour.
57# It exists to act as a base class for classes which only wish to
58# alter some parts of their behaviour.
59
60package Tie::StdHash;
61# @ISA = qw(Tie::Hash); # would inherit new() only
62
6313µs
# spent 1µs within Tie::StdHash::TIEHASH which was called: # once (1µs+0s) by File::Slurp::BEGIN@16 at line 564 of POSIX.pm
sub TIEHASH { bless {}, $_[0] }
64sub STORE { $_[0]->{$_[1]} = $_[2] }
65sub FETCH { $_[0]->{$_[1]} }
66sub FIRSTKEY { my $a = scalar keys %{$_[0]}; each %{$_[0]} }
67sub NEXTKEY { each %{$_[0]} }
68sub EXISTS { exists $_[0]->{$_[1]} }
69sub DELETE { delete $_[0]->{$_[1]} }
70sub CLEAR { %{$_[0]} = () }
71sub SCALAR { scalar %{$_[0]} }
72
73package Tie::ExtraHash;
74
75sub TIEHASH { my $p = shift; bless [{}, @_], $p }
76sub STORE { $_[0][0]{$_[1]} = $_[2] }
77sub FETCH { $_[0][0]{$_[1]} }
78sub FIRSTKEY { my $a = scalar keys %{$_[0][0]}; each %{$_[0][0]} }
79sub NEXTKEY { each %{$_[0][0]} }
80sub EXISTS { exists $_[0][0]->{$_[1]} }
81sub DELETE { delete $_[0][0]->{$_[1]} }
82sub CLEAR { %{$_[0][0]} = () }
83sub SCALAR { scalar %{$_[0][0]} }
84
8512µs1;