← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:22:58 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/5.12.3/x86_64-linux/Opcode.pm
StatementsExecuted 1788 statements in 3.13ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.60ms1.96msOpcode::::_init_optagsOpcode::_init_optags
111157µs217µsOpcode::::BEGIN@29Opcode::BEGIN@29
31621118µs118µsOpcode::::CORE:matchOpcode::CORE:match (opcode)
11163µs63µsOpcode::::opset_to_opsOpcode::opset_to_ops (xsub)
283162µs62µsOpcode::::CORE:readlineOpcode::CORE:readline (opcode)
191152µs52µsOpcode::::opsetOpcode::opset (xsub)
1011136µs36µsOpcode::::CORE:substOpcode::CORE:subst (opcode)
191120µs20µsOpcode::::define_optagOpcode::define_optag (xsub)
11119µs19µsOpcode::::BEGIN@3Opcode::BEGIN@3
11112µs12µsOpcode::::BEGIN@15Opcode::BEGIN@15
1118µs36µsOpcode::::BEGIN@11Opcode::BEGIN@11
1117µs9µsOpcode::::BEGIN@5Opcode::BEGIN@5
1116µs6µsOpcode::::CORE:closeOpcode::CORE:close (opcode)
1114µs4µsOpcode::::BEGIN@12Opcode::BEGIN@12
1113µs3µsOpcode::::BEGIN@13Opcode::BEGIN@13
1112µs2µsOpcode::::full_opsetOpcode::full_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
3329µs119µs
# spent 19µs within Opcode::BEGIN@3 which was called: # once (19µs+0s) by Safe::BEGIN@46 at line 3
use 5.006_001;
# spent 19µs making 1 call to Opcode::BEGIN@3
4
5350µs211µs
# spent 9µs (7+2) within Opcode::BEGIN@5 which was called: # once (7µs+2µs) by Safe::BEGIN@46 at line 5
use strict;
# spent 9µs making 1 call to Opcode::BEGIN@5 # spent 2µs making 1 call to strict::import
6
71500nsour($VERSION, @ISA, @EXPORT_OK);
8
91500ns$VERSION = "1.15";
10
11316µs264µs
# spent 36µs (8+28) within Opcode::BEGIN@11 which was called: # once (8µs+28µs) by Safe::BEGIN@46 at line 11
use Carp;
# spent 36µs making 1 call to Opcode::BEGIN@11 # spent 28µs making 1 call to Exporter::import
12314µs14µs
# spent 4µs within Opcode::BEGIN@12 which was called: # once (4µs+0s) by Safe::BEGIN@46 at line 12
use Exporter ();
# spent 4µs making 1 call to Opcode::BEGIN@12
13337µs13µs
# spent 3µs within Opcode::BEGIN@13 which was called: # once (3µs+0s) by Safe::BEGIN@46 at line 13
use XSLoader ();
# spent 3µs making 1 call to Opcode::BEGIN@13
14
15
# spent 12µs within Opcode::BEGIN@15 which was called: # once (12µs+0s) by Safe::BEGIN@46 at line 24
BEGIN {
16213µs @ISA = qw(Exporter);
17 @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 );
24128µs112µs}
# spent 12µs making 1 call to Opcode::BEGIN@15
25
26sub opset (;@);
27sub opset_to_hex ($);
28sub opdump (;$);
293520µs2277µs
# spent 217µs (157+60) within Opcode::BEGIN@29 which was called: # once (157µs+60µs) by Safe::BEGIN@46 at line 29
use subs @EXPORT_OK;
# spent 217µs making 1 call to Opcode::BEGIN@29 # spent 60µs making 1 call to subs::import
30
311446µs1438µsXSLoader::load 'Opcode', $VERSION;
# spent 438µs making 1 call to XSLoader::load
32
3312µs11.96ms_init_optags();
# spent 1.96ms 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 1.96ms (1.60+358µs) within Opcode::_init_optags which was called: # once (1.60ms+358µs) by Safe::BEGIN@46 at line 33
sub _init_optags {
559252µs my(%all, %seen);
56264µs @all{opset_to_ops(full_opset)} = (); # keys only
# spent 63µs making 1 call to Opcode::opset_to_ops # spent 2µs making 1 call to Opcode::full_opset
57
58 local($_);
59 local($/) = "\n=cut"; # skip to optags definition section
60138µs <DATA>;
# spent 38µs making 1 call to Opcode::CORE:readline
61 $/ = "\n="; # now read in 'pod section' chunks
6287µs while(<DATA>) {
# spent 7µs making 8 calls to Opcode::CORE:readline, avg 925ns/call
63140613µs2631µs next unless m/^item\s+(:\w+)/;
# spent 31µs making 26 calls to Opcode::CORE:match, avg 1µs/call
64 my $tag = $1;
65
66 # Split into lines, keep only indented lines
67290470µs29088µs my @lines = grep { m/^\s/ } split(/\n/);
# spent 88µs making 290 calls to Opcode::CORE:match, avg 302ns/call
68101169µs10136µs foreach (@lines) { s/--.*// } # delete comments
# spent 36µs making 101 calls to Opcode::CORE:subst, avg 357ns/call
6910165µs my @ops = map { split ' ' } @lines; # get op words
70
71 foreach(@ops) {
721122395µs warn "$tag - $_ already tagged in $seen{$_}\n" if $seen{$_};
73 $seen{$_} = $tag;
74 delete $all{$_};
75 }
76 # opset will croak on invalid names
775789µs define_optag($tag, opset(@ops));
# spent 52µs making 19 calls to Opcode::opset, avg 3µs/call # spent 20µs making 19 calls to Opcode::define_optag, avg 1µs/call # spent 17µs making 19 calls to Opcode::CORE:readline, avg 905ns/call
78 }
7916µs close(DATA);
# spent 6µs making 1 call to Opcode::CORE:close
80 warn "Untagged opnames: ".join(' ',keys %all)."\n" if %all;
81}
82
83
8417µs1;
85
86__DATA__
 
# spent 6µs within Opcode::CORE:close which was called: # once (6µs+0s) by Opcode::_init_optags at line 79
sub Opcode::CORE:close; # opcode
# spent 118µs within Opcode::CORE:match which was called 316 times, avg 375ns/call: # 290 times (88µs+0s) by Opcode::_init_optags at line 67, avg 302ns/call # 26 times (31µs+0s) by Opcode::_init_optags at line 63, avg 1µs/call
sub Opcode::CORE:match; # opcode
# spent 62µs within Opcode::CORE:readline which was called 28 times, avg 2µs/call: # 19 times (17µs+0s) by Opcode::_init_optags at line 77, avg 905ns/call # 8 times (7µs+0s) by Opcode::_init_optags at line 62, avg 925ns/call # once (38µs+0s) by Opcode::_init_optags at line 60
sub Opcode::CORE:readline; # opcode
# spent 36µs within Opcode::CORE:subst which was called 101 times, avg 357ns/call: # 101 times (36µs+0s) by Opcode::_init_optags at line 68, avg 357ns/call
sub Opcode::CORE:subst; # opcode
# spent 20µs within Opcode::define_optag which was called 19 times, avg 1µs/call: # 19 times (20µs+0s) by Opcode::_init_optags at line 77, avg 1µs/call
sub Opcode::define_optag; # xsub
# spent 2µs within Opcode::full_opset which was called: # once (2µs+0s) by Opcode::_init_optags at line 56
sub Opcode::full_opset; # xsub
# spent 52µs within Opcode::opset which was called 19 times, avg 3µs/call: # 19 times (52µs+0s) by Opcode::_init_optags at line 77, avg 3µs/call
sub Opcode::opset; # xsub
# spent 63µs within Opcode::opset_to_ops which was called: # once (63µs+0s) by Opcode::_init_optags at line 56
sub Opcode::opset_to_ops; # xsub