← 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/share/perl/5.36/if.pm
StatementsExecuted 43 statements in 442µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
42122µs26µsif::::workif::work
1117µs8µsif::::BEGIN@2if::BEGIN@2
3324µs4µsif::::unimportif::unimport
1112µs2µsif::::importif::import
3112µs2µsif::::CORE:substif::CORE:subst (opcode)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package if;
22125µs210µs
# spent 8µs (7+2) within if::BEGIN@2 which was called: # once (7µs+2µs) by IO::Prompter::BEGIN@6 at line 2
use strict;
# spent 8µs making 1 call to if::BEGIN@2 # spent 2µs making 1 call to strict::import
31200nsour $VERSION = '0.0610';
4
5
# spent 26µs (22+5) within if::work which was called 4 times, avg 7µs/call: # 3 times (20µs+5µs) by Contextual::Return::BEGIN@246 or Contextual::Return::BEGIN@252 or IO::Prompter::BEGIN@6 at line 21, avg 8µs/call # once (2µs+0s) by Pod::Simple::BlackBox::BEGIN@289 at line 20
sub work {
642µs my $method = shift() ? 'import' : 'unimport';
741µs unless (@_ >= 2) {
8 my $type = ($method eq 'import') ? 'use' : 'no';
9 die "Too few arguments to '$type if' (some code returning an empty list in list context?)"
10 }
1142µs return unless shift; # CONDITION
12
133700ns my $p = $_[0]; # PACKAGE
1436µs32µs (my $file = "$p.pm") =~ s!::!/!g;
# spent 2µs making 3 calls to if::CORE:subst, avg 600ns/call
153600ns require $file; # Works even if $_[0] is a keyword (like open)
16311µs33µs my $m = $p->can($method);
# spent 3µs making 3 calls to UNIVERSAL::can, avg 1µs/call
1738µs333µs goto &$m if $m;
# spent 33µs making 3 calls to warnings::unimport, avg 11µs/call
18}
19
2035µs12µs
# spent 2µs within if::import which was called: # once (2µs+0s) by Pod::Simple::BlackBox::BEGIN@289 at line 289 of Pod/Simple/BlackBox.pm
sub import { shift; unshift @_, 1; goto &work }
# spent 2µs making 1 call to if::work
219278µs325µs
# spent 4µs within if::unimport which was called 3 times, avg 1µs/call: # once (2µs+0s) by IO::Prompter::BEGIN@6 at line 6 of IO/Prompter.pm # once (1µs+0s) by Contextual::Return::BEGIN@246 at line 246 of Contextual/Return.pm # once (1µs+0s) by Contextual::Return::BEGIN@252 at line 252 of Contextual/Return.pm
sub unimport { shift; unshift @_, 0; goto &work }
# spent 25µs making 3 calls to if::work, avg 8µs/call
22
2312µs1;
24__END__
 
# spent 2µs within if::CORE:subst which was called 3 times, avg 600ns/call: # 3 times (2µs+0s) by if::work at line 14, avg 600ns/call
sub if::CORE:subst; # opcode