← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/local/src/github.com/foswiki/core/bin/view
  Run on Sun Dec 4 17:17:59 2011
Reported on Sun Dec 4 17:27:12 2011

Filename/usr/lib/perl/5.14/Opcode.pm
StatementsExecuted 1794 statements in 8.29ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1115.54ms6.60msOpcode::::_init_optagsOpcode::_init_optags
31621521µs521µsOpcode::::CORE:matchOpcode::CORE:match (opcode)
111328µs328µsOpcode::::BEGIN@3Opcode::BEGIN@3
111278µs515µsOpcode::::BEGIN@29Opcode::BEGIN@29
10111172µs172µsOpcode::::CORE:substOpcode::CORE:subst (opcode)
2831117µs117µsOpcode::::CORE:readlineOpcode::CORE:readline (opcode)
2022109µs109µsOpcode::::opsetOpcode::opset (xsub)
11187µs87µsOpcode::::opset_to_opsOpcode::opset_to_ops (xsub)
191149µs49µsOpcode::::define_optagOpcode::define_optag (xsub)
11135µs173µsOpcode::::_safe_call_svOpcode::_safe_call_sv (xsub)
11118µs18µsOpcode::::BEGIN@15Opcode::BEGIN@15
11117µs126µsOpcode::::BEGIN@11Opcode::BEGIN@11
11117µs25µsOpcode::::BEGIN@5Opcode::BEGIN@5
11112µs12µsOpcode::::BEGIN@13Opcode::BEGIN@13
11111µs11µsOpcode::::CORE:closeOpcode::CORE:close (opcode)
1119µs9µsOpcode::::_safe_pkg_prepOpcode::_safe_pkg_prep (xsub)
1119µs9µsOpcode::::BEGIN@12Opcode::BEGIN@12
1113µs3µsOpcode::::full_opsetOpcode::full_opset (xsub)
1113µs3µsOpcode::::invert_opsetOpcode::invert_opset (xsub)
0000s0sOpcode::::opdumpOpcode::opdump
0000s0sOpcode::::ops_to_opsetOpcode::ops_to_opset
0000s0sOpcode::::opset_to_hexOpcode::opset_to_hex
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Opcode;
2
3276µs1328µs
# spent 328µs within Opcode::BEGIN@3 which was called: # once (328µs+0s) by Safe::BEGIN@46 at line 3
use 5.006_001;
# spent 328µs making 1 call to Opcode::BEGIN@3
4
5280µs232µs
# spent 25µs (17+8) within Opcode::BEGIN@5 which was called: # once (17µs+8µs) by Safe::BEGIN@46 at line 5
use strict;
# spent 25µs making 1 call to Opcode::BEGIN@5 # spent 8µs making 1 call to strict::import
6
712µsour($VERSION, @ISA, @EXPORT_OK);
8
912µs$VERSION = "1.18";
10
11244µs2234µs
# spent 126µs (17+109) within Opcode::BEGIN@11 which was called: # once (17µs+109µs) by Safe::BEGIN@46 at line 11
use Carp;
# spent 126µs making 1 call to Opcode::BEGIN@11 # spent 109µs making 1 call to Exporter::import
12241µs19µs
# spent 9µs within Opcode::BEGIN@12 which was called: # once (9µs+0s) by Safe::BEGIN@46 at line 12
use Exporter ();
# spent 9µs making 1 call to Opcode::BEGIN@12
13278µs112µs
# spent 12µs within Opcode::BEGIN@13 which was called: # once (12µs+0s) by Safe::BEGIN@46 at line 13
use XSLoader;
# spent 12µs making 1 call to Opcode::BEGIN@13
14
15
# spent 18µs within Opcode::BEGIN@15 which was called: # once (18µs+0s) by Safe::BEGIN@46 at line 24
BEGIN {
1618µs @ISA = qw(Exporter);
17111µs @EXPORT_OK = qw(
18 opset ops_to_opset
19 opset_to_ops opset_to_hex invert_opset
20 empty_opset full_opset
21 opdesc opcodes opmask define_optag
22 opmask_add verify_opset opdump
23 );
24162µs118µs}
# spent 18µs making 1 call to Opcode::BEGIN@15
25
26sub opset (;@);
27sub opset_to_hex ($);
28sub opdump (;$);
292835µs2752µs
# spent 515µs (278+237) within Opcode::BEGIN@29 which was called: # once (278µs+237µs) by Safe::BEGIN@46 at line 29
use subs @EXPORT_OK;
# spent 515µs making 1 call to Opcode::BEGIN@29 # spent 237µs making 1 call to subs::import
30
311431µs1419µsXSLoader::load();
# spent 419µs making 1 call to XSLoader::load
32
3316µs16.60ms_init_optags();
# spent 6.60ms making 1 call to Opcode::_init_optags
34
35sub ops_to_opset { opset @_ } # alias for old name
36
37sub opset_to_hex ($) {
38 return "(invalid opset)" unless verify_opset($_[0]);
39 unpack("h*",$_[0]);
40}
41
42sub opdump (;$) {
43 my $pat = shift;
44 # handy utility: perl -MOpcode=opdump -e 'opdump File'
45 foreach(opset_to_ops(full_opset)) {
46 my $op = sprintf " %12s %s\n", $_, opdesc($_);
47 next if defined $pat and $op !~ m/$pat/i;
48 print $op;
49 }
50}
51
- -
54
# spent 6.60ms (5.54+1.06) within Opcode::_init_optags which was called: # once (5.54ms+1.06ms) by Safe::BEGIN@46 at line 33
sub _init_optags {
5512µs my(%all, %seen);
561241µs290µs @all{opset_to_ops(full_opset)} = (); # keys only
# spent 87µs making 1 call to Opcode::opset_to_ops # spent 3µs making 1 call to Opcode::full_opset
57
5811µs local($_);
5915µs local($/) = "\n=cut"; # skip to optags definition section
60157µs148µs <DATA>;
# spent 48µs making 1 call to Opcode::CORE:readline
6112µs $/ = "\n="; # now read in 'pod section' chunks
62157µs822µs while(<DATA>) {
# spent 22µs making 8 calls to Opcode::CORE:readline, avg 3µs/call
6326195µs2685µs next unless m/^item\s+(:\w+)/;
# spent 85µs making 26 calls to Opcode::CORE:match, avg 3µs/call
641947µs my $tag = $1;
65
66 # Split into lines, keep only indented lines
673092.11ms290436µs my @lines = grep { m/^\s/ } split(/\n/);
# spent 436µs making 290 calls to Opcode::CORE:match, avg 2µs/call
68120751µs101172µs foreach (@lines) { s/--.*// } # delete comments
# spent 172µs making 101 calls to Opcode::CORE:subst, avg 2µs/call
69120436µs my @ops = map { split ' ' } @lines; # get op words
70
711952µs foreach(@ops) {
72378483µs warn "$tag - $_ already tagged in $seen{$_}\n" if $seen{$_};
73378636µs $seen{$_} = $tag;
74378994µs delete $all{$_};
75 }
76 # opset will croak on invalid names
7719464µs57199µs define_optag($tag, opset(@ops));
# spent 104µs making 19 calls to Opcode::opset, avg 5µs/call # spent 49µs making 19 calls to Opcode::define_optag, avg 3µs/call # spent 47µs making 19 calls to Opcode::CORE:readline, avg 2µs/call
78 }
79119µs111µs close(DATA);
# spent 11µs making 1 call to Opcode::CORE:close
80150µs warn "Untagged opnames: ".join(' ',keys %all)."\n" if %all;
81}
82
83
8418µs1;
85
86__DATA__
 
# spent 11µs within Opcode::CORE:close which was called: # once (11µs+0s) by Opcode::_init_optags at line 79
sub Opcode::CORE:close; # opcode
# spent 521µs within Opcode::CORE:match which was called 316 times, avg 2µs/call: # 290 times (436µs+0s) by Opcode::_init_optags at line 67, avg 2µs/call # 26 times (85µs+0s) by Opcode::_init_optags at line 63, avg 3µs/call
sub Opcode::CORE:match; # opcode
# spent 117µs within Opcode::CORE:readline which was called 28 times, avg 4µs/call: # 19 times (47µs+0s) by Opcode::_init_optags at line 77, avg 2µs/call # 8 times (22µs+0s) by Opcode::_init_optags at line 62, avg 3µs/call # once (48µs+0s) by Opcode::_init_optags at line 60
sub Opcode::CORE:readline; # opcode
# spent 172µs within Opcode::CORE:subst which was called 101 times, avg 2µs/call: # 101 times (172µs+0s) by Opcode::_init_optags at line 68, avg 2µs/call
sub Opcode::CORE:subst; # opcode
# spent 173µs (35+138) within Opcode::_safe_call_sv which was called: # once (35µs+138µs) by Safe::reval at line 358 of Safe.pm
sub Opcode::_safe_call_sv; # xsub
# spent 9µs within Opcode::_safe_pkg_prep which was called: # once (9µs+0s) by Safe::new at line 171 of Safe.pm
sub Opcode::_safe_pkg_prep; # xsub
# spent 49µs within Opcode::define_optag which was called 19 times, avg 3µs/call: # 19 times (49µs+0s) by Opcode::_init_optags at line 77, avg 3µs/call
sub Opcode::define_optag; # xsub
# spent 3µs within Opcode::full_opset which was called: # once (3µs+0s) by Opcode::_init_optags at line 56
sub Opcode::full_opset; # xsub
# spent 3µs within Opcode::invert_opset which was called: # once (3µs+0s) by Safe::permit_only at line 257 of Safe.pm
sub Opcode::invert_opset; # xsub
# spent 109µs within Opcode::opset which was called 20 times, avg 5µs/call: # 19 times (104µs+0s) by Opcode::_init_optags at line 77, avg 5µs/call # once (5µs+0s) by Safe::permit_only at line 257 of Safe.pm
sub Opcode::opset; # xsub
# spent 87µs within Opcode::opset_to_ops which was called: # once (87µs+0s) by Opcode::_init_optags at line 56
sub Opcode::opset_to_ops; # xsub