Commit | Line | Data |
8e30e889 |
1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
3 | <!-- |
4 | This file was generated by Devel::NYTProf version 4.06 |
5 | --> |
6 | <head> |
7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
8 | <meta http-equiv="Content-Language" content="en-us" /> |
9 | <title>Profile of PPI/Util.pm</title> |
10 | <link rel="stylesheet" type="text/css" href="style.css" /> |
11 | <script type="text/javascript" src="js/jquery-min.js"></script> |
12 | |
13 | <script type="text/javascript" src="js/jquery-tablesorter-min.js"></script> |
14 | <link rel="stylesheet" type="text/css" href="js/style-tablesorter.css" /> |
15 | <script type="text/javascript"> |
16 | // when a column is first clicked on to sort it, use descending order |
17 | // XXX doesn't seem to work (and not just because the tablesorter formatSortingOrder() is broken) |
18 | $.tablesorter.defaults.sortInitialOrder = "desc"; |
19 | // add parser through the tablesorter addParser method |
20 | $.tablesorter.addParser({ |
21 | id: 'fmt_time', // name of this parser |
22 | is: function(s) { |
23 | return false; // return false so this parser is not auto detected |
24 | }, |
25 | format: function(orig) { // format data for normalization |
26 | // console.log(orig); |
27 | val = orig.replace(/ns/,''); |
28 | if (val != orig) { return val / (1000*1000*1000); } |
29 | val = orig.replace(/µs/,''); /* XXX use µ ? */ |
30 | if (val != orig) { return val / (1000*1000); } |
31 | var val = orig.replace(/ms/,''); |
32 | if (val != orig) { return val / (1000); } |
33 | var val = orig.replace(/s/,''); |
34 | if (val != orig) { return val; } |
35 | if (orig == '0') { return orig; } |
36 | console.log('no match for fmt_time of '.concat(orig)); |
37 | return orig; |
38 | }, |
39 | type: 'numeric' // set type, either numeric or text |
40 | }); |
41 | </script> |
42 | </head> |
43 | |
44 | <body > |
45 | <div class="header" style="position: relative; overflow-x: hidden; overflow-y: hidden; z-index: 0; "> |
46 | <div class="header_back"> |
47 | <a href="index.html">← Index</a> |
48 | </div> |
49 | <div class="headerForeground" style="float: left"> |
50 | <span class="siteTitle">NYTProf Performance Profile</span> |
51 | <span class="siteSubtitle">  <span>« <span class="mode_btn"><a href="PPI-Util-pm-915-block.html">block view</a></span> • <span class="mode_btn"><a href="PPI-Util-pm-915-line.html">line view</a></span> • <span class="mode_btn mode_btn_selected">sub view</span> »</span><br /> |
52 | For script/nytprof.pl |
53 | </span> |
54 | </div> |
55 | <div class="headerForeground" style="float: right; text-align: right"> |
56 | <span class="siteTitle"> </span> |
57 | <span class="siteSubtitle">Run on Thu May 31 16:49:15 2012<br />Reported on Thu May 31 16:50:48 2012</span> |
58 | </div> |
59 | <div style="position: absolute; left: 0px; top: 0%; width: 100%; height: 101%; z-index: -1; background-color: rgb(17, 136, 255); "></div> |
60 | <div style="position: absolute; left: 0px; top: 2%; width: 100%; height: 99%; z-index: -1; background-color: rgb(16, 134, 253); "></div> |
61 | <div style="position: absolute; left: 0px; top: 4%; width: 100%; height: 97%; z-index: -1; background-color: rgb(16, 133, 252); "></div> |
62 | <div style="position: absolute; left: 0px; top: 6%; width: 100%; height: 95%; z-index: -1; background-color: rgb(15, 131, 250); "></div> |
63 | <div style="position: absolute; left: 0px; top: 8%; width: 100%; height: 93%; z-index: -1; background-color: rgb(15, 130, 249); "></div> |
64 | <div style="position: absolute; left: 0px; top: 10%; width: 100%; height: 91%; z-index: -1; background-color: rgb(15, 129, 248); "></div> |
65 | <div style="position: absolute; left: 0px; top: 12%; width: 100%; height: 89%; z-index: -1; background-color: rgb(14, 127, 246); "></div> |
66 | <div style="position: absolute; left: 0px; top: 14%; width: 100%; height: 87%; z-index: -1; background-color: rgb(14, 126, 245); "></div> |
67 | <div style="position: absolute; left: 0px; top: 16%; width: 100%; height: 85%; z-index: -1; background-color: rgb(14, 125, 244); "></div> |
68 | <div style="position: absolute; left: 0px; top: 18%; width: 100%; height: 83%; z-index: -1; background-color: rgb(13, 123, 242); "></div> |
69 | <div style="position: absolute; left: 0px; top: 20%; width: 100%; height: 81%; z-index: -1; background-color: rgb(13, 122, 241); "></div> |
70 | <div style="position: absolute; left: 0px; top: 22%; width: 100%; height: 79%; z-index: -1; background-color: rgb(13, 121, 240); "></div> |
71 | <div style="position: absolute; left: 0px; top: 24%; width: 100%; height: 77%; z-index: -1; background-color: rgb(12, 119, 238); "></div> |
72 | <div style="position: absolute; left: 0px; top: 26%; width: 100%; height: 75%; z-index: -1; background-color: rgb(12, 118, 237); "></div> |
73 | <div style="position: absolute; left: 0px; top: 28%; width: 100%; height: 73%; z-index: -1; background-color: rgb(12, 116, 235); "></div> |
74 | <div style="position: absolute; left: 0px; top: 30%; width: 100%; height: 71%; z-index: -1; background-color: rgb(11, 115, 234); "></div> |
75 | <div style="position: absolute; left: 0px; top: 32%; width: 100%; height: 69%; z-index: -1; background-color: rgb(11, 114, 233); "></div> |
76 | <div style="position: absolute; left: 0px; top: 34%; width: 100%; height: 67%; z-index: -1; background-color: rgb(11, 112, 231); "></div> |
77 | <div style="position: absolute; left: 0px; top: 36%; width: 100%; height: 65%; z-index: -1; background-color: rgb(10, 111, 230); "></div> |
78 | <div style="position: absolute; left: 0px; top: 38%; width: 100%; height: 63%; z-index: -1; background-color: rgb(10, 110, 229); "></div> |
79 | <div style="position: absolute; left: 0px; top: 40%; width: 100%; height: 61%; z-index: -1; background-color: rgb(10, 108, 227); "></div> |
80 | <div style="position: absolute; left: 0px; top: 42%; width: 100%; height: 59%; z-index: -1; background-color: rgb(9, 107, 226); "></div> |
81 | <div style="position: absolute; left: 0px; top: 44%; width: 100%; height: 57%; z-index: -1; background-color: rgb(9, 106, 225); "></div> |
82 | <div style="position: absolute; left: 0px; top: 46%; width: 100%; height: 55%; z-index: -1; background-color: rgb(9, 104, 223); "></div> |
83 | <div style="position: absolute; left: 0px; top: 48%; width: 100%; height: 53%; z-index: -1; background-color: rgb(8, 103, 222); "></div> |
84 | <div style="position: absolute; left: 0px; top: 50%; width: 100%; height: 51%; z-index: -1; background-color: rgb(8, 102, 221); "></div> |
85 | <div style="position: absolute; left: 0px; top: 52%; width: 100%; height: 49%; z-index: -1; background-color: rgb(8, 100, 219); "></div> |
86 | <div style="position: absolute; left: 0px; top: 54%; width: 100%; height: 47%; z-index: -1; background-color: rgb(7, 99, 218); "></div> |
87 | <div style="position: absolute; left: 0px; top: 56%; width: 100%; height: 45%; z-index: -1; background-color: rgb(7, 97, 216); "></div> |
88 | <div style="position: absolute; left: 0px; top: 58%; width: 100%; height: 43%; z-index: -1; background-color: rgb(7, 96, 215); "></div> |
89 | <div style="position: absolute; left: 0px; top: 60%; width: 100%; height: 41%; z-index: -1; background-color: rgb(6, 95, 214); "></div> |
90 | <div style="position: absolute; left: 0px; top: 62%; width: 100%; height: 39%; z-index: -1; background-color: rgb(6, 93, 212); "></div> |
91 | <div style="position: absolute; left: 0px; top: 64%; width: 100%; height: 37%; z-index: -1; background-color: rgb(6, 92, 211); "></div> |
92 | <div style="position: absolute; left: 0px; top: 66%; width: 100%; height: 35%; z-index: -1; background-color: rgb(5, 91, 210); "></div> |
93 | <div style="position: absolute; left: 0px; top: 68%; width: 100%; height: 33%; z-index: -1; background-color: rgb(5, 89, 208); "></div> |
94 | <div style="position: absolute; left: 0px; top: 70%; width: 100%; height: 31%; z-index: -1; background-color: rgb(5, 88, 207); "></div> |
95 | <div style="position: absolute; left: 0px; top: 72%; width: 100%; height: 29%; z-index: -1; background-color: rgb(4, 87, 206); "></div> |
96 | <div style="position: absolute; left: 0px; top: 74%; width: 100%; height: 27%; z-index: -1; background-color: rgb(4, 85, 204); "></div> |
97 | <div style="position: absolute; left: 0px; top: 76%; width: 100%; height: 25%; z-index: -1; background-color: rgb(4, 84, 203); "></div> |
98 | <div style="position: absolute; left: 0px; top: 78%; width: 100%; height: 23%; z-index: -1; background-color: rgb(3, 82, 201); "></div> |
99 | <div style="position: absolute; left: 0px; top: 80%; width: 100%; height: 21%; z-index: -1; background-color: rgb(3, 81, 200); "></div> |
100 | <div style="position: absolute; left: 0px; top: 82%; width: 100%; height: 19%; z-index: -1; background-color: rgb(3, 80, 199); "></div> |
101 | <div style="position: absolute; left: 0px; top: 84%; width: 100%; height: 17%; z-index: -1; background-color: rgb(2, 78, 197); "></div> |
102 | <div style="position: absolute; left: 0px; top: 86%; width: 100%; height: 15%; z-index: -1; background-color: rgb(2, 77, 196); "></div> |
103 | <div style="position: absolute; left: 0px; top: 88%; width: 100%; height: 13%; z-index: -1; background-color: rgb(2, 76, 195); "></div> |
104 | <div style="position: absolute; left: 0px; top: 90%; width: 100%; height: 11%; z-index: -1; background-color: rgb(1, 74, 193); "></div> |
105 | <div style="position: absolute; left: 0px; top: 92%; width: 100%; height: 9%; z-index: -1; background-color: rgb(1, 73, 192); "></div> |
106 | <div style="position: absolute; left: 0px; top: 94%; width: 100%; height: 7%; z-index: -1; background-color: rgb(1, 72, 191); "></div> |
107 | <div style="position: absolute; left: 0px; top: 96%; width: 100%; height: 5%; z-index: -1; background-color: rgb(0, 70, 189); "></div> |
108 | <div style="position: absolute; left: 0px; top: 98%; width: 100%; height: 3%; z-index: -1; background-color: rgb(0, 69, 188); "></div> |
109 | <div style="position: absolute; left: 0px; top: 100%; width: 100%; height: 1%; z-index: -1; background-color: rgb(0, 68, 187); "></div> |
110 | </div> |
111 | |
112 | <div class="body_content"><br /> |
113 | <table class="file_summary"><tr><td class="h">Filename</td><td align="left"><a href="file:///Users/edenc/perl5/lib/perl5/PPI/Util.pm">/Users/edenc/perl5/lib/perl5/PPI/Util.pm</a></td></tr> |
114 | <tr><td class="h">Statements</td><td align="left">Executed 18 statements in 749µs</td></tr></table> |
115 | |
116 | <table id="subs_table" border="1" cellpadding="0" class="tablesorter"> |
117 | <caption>Subroutines</caption> |
118 | <thead> |
119 | <tr> |
120 | <th>Calls</th> |
121 | <th><span title="Number of Places sub is called from">P</span></th> |
122 | <th><span title="Number of Files sub is called from">F</span></th> |
123 | <th>Exclusive<br />Time</th> |
124 | <th>Inclusive<br />Time</th> |
125 | <th>Subroutine</th> |
126 | </tr> |
127 | </thead> |
128 | <tbody> |
129 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c0"><span title="0.0%">925µs</span></td><td class="c0"><span title="0.0%">1.40ms</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@7</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#7">BEGIN@7</a></span></td></tr> |
130 | <tr><td class="c0">279</td><td class="c0">17</td><td class="c0">8</td><td class="c0"><span title="0.0%">158µs</span></td><td class="c0"><span title="0.0%">158µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::TRUE</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#PPI__Util__TRUE">TRUE</a> (xsub)</span></td></tr> |
131 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c2"><span title="0.0%">15µs</span></td><td class="c3"><span title="0.0%">18µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@5</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#5">BEGIN@5</a></span></td></tr> |
132 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c2"><span title="0.0%">14µs</span></td><td class="c3"><span title="0.0%">61µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@8</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#8">BEGIN@8</a></span></td></tr> |
133 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c3"><span title="0.0%">12µs</span></td><td class="c3"><span title="0.0%">12µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@11</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#11">BEGIN@11</a></span></td></tr> |
134 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c3"><span title="0.0%">11µs</span></td><td class="c3"><span title="0.0%">60µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@18</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#18">BEGIN@18</a></span></td></tr> |
135 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c3"><span title="0.0%">9µs</span></td><td class="c3"><span title="0.0%">39µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@22</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#22">BEGIN@22</a></span></td></tr> |
136 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c3"><span title="0.0%">8µs</span></td><td class="c3"><span title="0.0%">55µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@10</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#10">BEGIN@10</a></span></td></tr> |
137 | <tr><td class="c3">1</td><td class="c3">1</td><td class="c3">1</td><td class="c3"><span title="0.0%">4µs</span></td><td class="c3"><span title="0.0%">4µs</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::BEGIN@6</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#6">BEGIN@6</a></span></td></tr> |
138 | <tr><td class="c3">0</td><td class="c3">0</td><td class="c3">0</td><td class="c3"><span title="0.0%">0s</span></td><td class="c3"><span title="0.0%">0s</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::_Document</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#38">_Document</a></span></td></tr> |
139 | <tr><td class="c3">0</td><td class="c3">0</td><td class="c3">0</td><td class="c3"><span title="0.0%">0s</span></td><td class="c3"><span title="0.0%">0s</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::_slurp</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#50">_slurp</a></span></td></tr> |
140 | <tr><td class="c3">0</td><td class="c3">0</td><td class="c3">0</td><td class="c3"><span title="0.0%">0s</span></td><td class="c3"><span title="0.0%">0s</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::md5hex</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#62">md5hex</a></span></td></tr> |
141 | <tr><td class="c3">0</td><td class="c3">0</td><td class="c3">0</td><td class="c3"><span title="0.0%">0s</span></td><td class="c3"><span title="0.0%">0s</span></td><td class="sub_name"><span style="display: none;">PPI::Util::::md5hex_file</span>PPI::Util::<a href="PPI-Util-pm-915-sub.html#69">md5hex_file</a></span></td></tr> |
142 | </tbody></table> |
143 | Call graph for these subroutines as a |
144 | <a href="http://en.wikipedia.org/wiki/Graphviz">Graphviz</a> |
145 | <a href="Users-edenc-perl5-lib-perl5-PPI-Util-pm.dot">dot language file</a>. |
146 | |
147 | <table border="1" cellpadding="0"> |
148 | <thead> |
149 | <tr><th>Line</th> |
150 | <th><span title="Number of statements executed">State<br />ments</span></th> |
151 | <th><span title="Time spend executing statements on the line, |
152 | excluding time spent executing statements in any called subroutines">Time<br />on line</span></th> |
153 | <th><span title="Number of subroutines calls">Calls</span></th> |
154 | <th><span title="Time spent in subroutines called (inclusive)">Time<br />in subs</span></th> |
155 | <th class="left_indent_header">Code</th> |
156 | </tr> |
157 | |
158 | </thead> |
159 | <tbody> |
160 | <tr><td class="h"><a name="1"></a>1</td><td></td><td></td><td></td><td></td><td class="s">package PPI::Util;</td></tr> |
161 | <tr><td class="h"><a name="2"></a>2</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
162 | <tr><td class="h"><a name="3"></a>3</td><td></td><td></td><td></td><td></td><td class="s"># Provides some common utility functions that can be imported</td></tr> |
163 | <tr><td class="h"><a name="4"></a>4</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
164 | <tr><td class="h"><a name="5"></a>5</td><td class="c3">2</td><td class="c3"><span title="Avg 12µs">24µs</span></td><td class="c3">2</td><td class="c3">21µs</td><td class="s"><div class="calls"><div class="calls_in"># spent 18µs (15+3) within PPI::Util::BEGIN@5 which was called: |
165 | # once (15µs+3µs) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#5">line 5</a></div></div>use strict;<div class="calls"><div class="calls_out"># spent 18µs making 1 call to <a href="PPI-Util-pm-915-sub.html#5">PPI::Util::BEGIN@5</a> |
166 | # spent 3µs making 1 call to <a href="strict-pm-3-sub.html#34">strict::import</a></div></div></td></tr> |
167 | <tr><td class="h"><a name="6"></a>6</td><td class="c3">2</td><td class="c3"><span title="Avg 10µs">19µs</span></td><td class="c3">1</td><td class="c3">4µs</td><td class="s"><div class="calls"><div class="calls_in"># spent 4µs within PPI::Util::BEGIN@6 which was called: |
168 | # once (4µs+0s) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#6">line 6</a></div></div>use Exporter ();<div class="calls"><div class="calls_out"># spent 4µs making 1 call to <a href="PPI-Util-pm-915-sub.html#6">PPI::Util::BEGIN@6</a></div></div></td></tr> |
169 | <tr><td class="h"><a name="7"></a>7</td><td class="c3">2</td><td class="c0"><span title="Avg 74µs">149µs</span></td><td class="c3">1</td><td class="c0">1.40ms</td><td class="s"><div class="calls"><div class="calls_in"># spent 1.40ms (925µs+474µs) within PPI::Util::BEGIN@7 which was called: |
170 | # once (925µs+474µs) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#7">line 7</a></div></div>use Digest::MD5 ();<div class="calls"><div class="calls_out"># spent 1.40ms making 1 call to <a href="PPI-Util-pm-915-sub.html#7">PPI::Util::BEGIN@7</a></div></div></td></tr> |
171 | <tr><td class="h"><a name="8"></a>8</td><td class="c3">2</td><td class="c3"><span title="Avg 17µs">35µs</span></td><td class="c3">2</td><td class="c3">108µs</td><td class="s"><div class="calls"><div class="calls_in"># spent 61µs (14+47) within PPI::Util::BEGIN@8 which was called: |
172 | # once (14µs+47µs) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#8">line 8</a></div></div>use Params::Util qw{_INSTANCE _SCALAR0 _ARRAY0};<div class="calls"><div class="calls_out"># spent 61µs making 1 call to <a href="PPI-Util-pm-915-sub.html#8">PPI::Util::BEGIN@8</a> |
173 | # spent 47µs making 1 call to <a href="Exporter-pm-8-sub.html#28">Exporter::import</a></div></div></td></tr> |
174 | <tr><td class="h"><a name="9"></a>9</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
175 | <tr><td class="h"><a name="10"></a>10</td><td class="c3">2</td><td class="c2"><span title="Avg 24µs">48µs</span></td><td class="c3">2</td><td class="c3">102µs</td><td class="s"><div class="calls"><div class="calls_in"># spent 55µs (8+47) within PPI::Util::BEGIN@10 which was called: |
176 | # once (8µs+47µs) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#10">line 10</a></div></div>use vars qw{$VERSION @ISA @EXPORT_OK};<div class="calls"><div class="calls_out"># spent 55µs making 1 call to <a href="PPI-Util-pm-915-sub.html#10">PPI::Util::BEGIN@10</a> |
177 | # spent 47µs making 1 call to <a href="vars-pm-6-sub.html#10">vars::import</a></div></div></td></tr> |
178 | <tr><td class="h"><a name="11"></a>11</td><td></td><td></td><td></td><td></td><td class="s"><div class="calls"><div class="calls_in"># spent 12µs within PPI::Util::BEGIN@11 which was called: |
179 | # once (12µs+0s) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#15">line 15</a></div></div>BEGIN {</td></tr> |
180 | <tr><td class="h"><a name="12"></a>12</td><td class="c1">3</td><td class="c3"><span title="Avg 4µs">11µs</span></td><td></td><td></td><td class="s"> $VERSION = '1.215';</td></tr> |
181 | <tr><td class="h"><a name="13"></a>13</td><td></td><td></td><td></td><td></td><td class="s"> @ISA = 'Exporter';</td></tr> |
182 | <tr><td class="h"><a name="14"></a>14</td><td></td><td></td><td></td><td></td><td class="s"> @EXPORT_OK = qw{_Document _slurp};</td></tr> |
183 | <tr><td class="h"><a name="15"></a>15</td><td class="c3">1</td><td class="c3"><span title="Avg 33µs">33µs</span></td><td class="c3">1</td><td class="c3">12µs</td><td class="s">}<div class="calls"><div class="calls_out"># spent 12µs making 1 call to <a href="PPI-Util-pm-915-sub.html#11">PPI::Util::BEGIN@11</a></div></div></td></tr> |
184 | <tr><td class="h"><a name="16"></a>16</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
185 | <tr><td class="h"><a name="17"></a>17</td><td></td><td></td><td></td><td></td><td class="s"># Alarms are used to catch unexpectedly slow and complex documents</td></tr> |
186 | <tr><td class="h"><a name="18"></a>18</td><td class="c3">2</td><td class="c3"><span title="Avg 19µs">37µs</span></td><td class="c3">2</td><td class="c3">109µs</td><td class="s"><div class="calls"><div class="calls_in"># spent 60µs (11+49) within PPI::Util::BEGIN@18 which was called: |
187 | # once (11µs+49µs) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#18">line 18</a></div></div>use constant HAVE_ALARM => ! ( $^O eq 'MSWin32' or $^O eq 'cygwin' );<div class="calls"><div class="calls_out"># spent 60µs making 1 call to <a href="PPI-Util-pm-915-sub.html#18">PPI::Util::BEGIN@18</a> |
188 | # spent 49µs making 1 call to <a href="constant-pm-28-sub.html#42">constant::import</a></div></div></td></tr> |
189 | <tr><td class="h"><a name="19"></a>19</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
190 | <tr><td class="h"><a name="20"></a>20</td><td></td><td></td><td></td><td></td><td class="s"># 5.8.7 was the first version to resolve the notorious</td></tr> |
191 | <tr><td class="h"><a name="21"></a>21</td><td></td><td></td><td></td><td></td><td class="s"># "unicode length caching" bug. See RT #FIXME</td></tr> |
192 | <tr><td class="h"><a name="22"></a>22</td><td class="c3">2</td><td class="c0"><span title="Avg 195µs">390µs</span></td><td class="c3">2</td><td class="c3">70µs</td><td class="s"><div class="calls"><div class="calls_in"># spent 39µs (9+31) within PPI::Util::BEGIN@22 which was called: |
193 | # once (9µs+31µs) by PPI::BEGIN@17 at <a href="PPI-Util-pm-915-sub.html#22">line 22</a></div></div>use constant HAVE_UNICODE => !! ( $] >= 5.008007 );<div class="calls"><div class="calls_out"># spent 39µs making 1 call to <a href="PPI-Util-pm-915-sub.html#22">PPI::Util::BEGIN@22</a> |
194 | # spent 31µs making 1 call to <a href="constant-pm-28-sub.html#42">constant::import</a></div></div></td></tr> |
195 | <tr><td class="h"><a name="23"></a>23</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
196 | <tr><td class="h"><a name="24"></a>24</td><td></td><td></td><td></td><td></td><td class="s"># Common reusable true and false functions</td></tr> |
197 | <tr><td class="h"><a name="25"></a>25</td><td></td><td></td><td></td><td></td><td class="s"># This makes it easy to upgrade many places in PPI::XS</td></tr> |
198 | <tr><td class="h"><a name="26"></a>26</td><td></td><td></td><td></td><td></td><td class="s">sub TRUE () { 1 }</td></tr> |
199 | <tr><td class="h"><a name="27"></a>27</td><td></td><td></td><td></td><td></td><td class="s">sub FALSE () { '' }</td></tr> |
200 | <tr><td class="h"><a name="28"></a>28</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
201 | <tr><td class="h"><a name="- -"></a>- -</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
202 | <tr><td class="h"><a name="33"></a>33</td><td></td><td></td><td></td><td></td><td class="s">#####################################################################</td></tr> |
203 | <tr><td class="h"><a name="34"></a>34</td><td></td><td></td><td></td><td></td><td class="s"># Functions</td></tr> |
204 | <tr><td class="h"><a name="35"></a>35</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
205 | <tr><td class="h"><a name="36"></a>36</td><td></td><td></td><td></td><td></td><td class="s"># Allows a sub that takes a L<PPI::Document> to handle the full range</td></tr> |
206 | <tr><td class="h"><a name="37"></a>37</td><td></td><td></td><td></td><td></td><td class="s"># of different things, including file names, SCALAR source, etc.</td></tr> |
207 | <tr><td class="h"><a name="38"></a>38</td><td></td><td></td><td></td><td></td><td class="s">sub _Document {</td></tr> |
208 | <tr><td class="h"><a name="39"></a>39</td><td></td><td></td><td></td><td></td><td class="s"> shift if @_ > 1;</td></tr> |
209 | <tr><td class="h"><a name="40"></a>40</td><td></td><td></td><td></td><td></td><td class="s"> return undef unless defined $_[0];</td></tr> |
210 | <tr><td class="h"><a name="41"></a>41</td><td></td><td></td><td></td><td></td><td class="s"> require PPI::Document;</td></tr> |
211 | <tr><td class="h"><a name="42"></a>42</td><td></td><td></td><td></td><td></td><td class="s"> return PPI::Document->new(shift) unless ref $_[0];</td></tr> |
212 | <tr><td class="h"><a name="43"></a>43</td><td></td><td></td><td></td><td></td><td class="s"> return PPI::Document->new(shift) if _SCALAR0($_[0]);</td></tr> |
213 | <tr><td class="h"><a name="44"></a>44</td><td></td><td></td><td></td><td></td><td class="s"> return PPI::Document->new(shift) if _ARRAY0($_[0]);</td></tr> |
214 | <tr><td class="h"><a name="45"></a>45</td><td></td><td></td><td></td><td></td><td class="s"> return shift if _INSTANCE($_[0], 'PPI::Document');</td></tr> |
215 | <tr><td class="h"><a name="46"></a>46</td><td></td><td></td><td></td><td></td><td class="s"> return undef;</td></tr> |
216 | <tr><td class="h"><a name="47"></a>47</td><td></td><td></td><td></td><td></td><td class="s">}</td></tr> |
217 | <tr><td class="h"><a name="48"></a>48</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
218 | <tr><td class="h"><a name="49"></a>49</td><td></td><td></td><td></td><td></td><td class="s"># Provide a simple _slurp implementation</td></tr> |
219 | <tr><td class="h"><a name="50"></a>50</td><td></td><td></td><td></td><td></td><td class="s">sub _slurp {</td></tr> |
220 | <tr><td class="h"><a name="51"></a>51</td><td></td><td></td><td></td><td></td><td class="s"> my $file = shift;</td></tr> |
221 | <tr><td class="h"><a name="52"></a>52</td><td></td><td></td><td></td><td></td><td class="s"> local $/ = undef;</td></tr> |
222 | <tr><td class="h"><a name="53"></a>53</td><td></td><td></td><td></td><td></td><td class="s"> local *FILE;</td></tr> |
223 | <tr><td class="h"><a name="54"></a>54</td><td></td><td></td><td></td><td></td><td class="s"> open( FILE, '<', $file ) or return "open($file) failed: $!";</td></tr> |
224 | <tr><td class="h"><a name="55"></a>55</td><td></td><td></td><td></td><td></td><td class="s"> my $source = <FILE>;</td></tr> |
225 | <tr><td class="h"><a name="56"></a>56</td><td></td><td></td><td></td><td></td><td class="s"> close( FILE ) or return "close($file) failed: $!";</td></tr> |
226 | <tr><td class="h"><a name="57"></a>57</td><td></td><td></td><td></td><td></td><td class="s"> return \$source;</td></tr> |
227 | <tr><td class="h"><a name="58"></a>58</td><td></td><td></td><td></td><td></td><td class="s">}</td></tr> |
228 | <tr><td class="h"><a name="59"></a>59</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
229 | <tr><td class="h"><a name="60"></a>60</td><td></td><td></td><td></td><td></td><td class="s"># Provides a version of Digest::MD5's md5hex that explicitly</td></tr> |
230 | <tr><td class="h"><a name="61"></a>61</td><td></td><td></td><td></td><td></td><td class="s"># works on the unix-newlined version of the content.</td></tr> |
231 | <tr><td class="h"><a name="62"></a>62</td><td></td><td></td><td></td><td></td><td class="s">sub md5hex {</td></tr> |
232 | <tr><td class="h"><a name="63"></a>63</td><td></td><td></td><td></td><td></td><td class="s"> my $string = shift;</td></tr> |
233 | <tr><td class="h"><a name="64"></a>64</td><td></td><td></td><td></td><td></td><td class="s"> $string =~ s/(?:\015{1,2}\012|\015|\012)/\015/gs;</td></tr> |
234 | <tr><td class="h"><a name="65"></a>65</td><td></td><td></td><td></td><td></td><td class="s"> Digest::MD5::md5_hex($string);</td></tr> |
235 | <tr><td class="h"><a name="66"></a>66</td><td></td><td></td><td></td><td></td><td class="s">}</td></tr> |
236 | <tr><td class="h"><a name="67"></a>67</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
237 | <tr><td class="h"><a name="68"></a>68</td><td></td><td></td><td></td><td></td><td class="s"># As above but slurps and calculates the id for a file by name</td></tr> |
238 | <tr><td class="h"><a name="69"></a>69</td><td></td><td></td><td></td><td></td><td class="s">sub md5hex_file {</td></tr> |
239 | <tr><td class="h"><a name="70"></a>70</td><td></td><td></td><td></td><td></td><td class="s"> my $file = shift;</td></tr> |
240 | <tr><td class="h"><a name="71"></a>71</td><td></td><td></td><td></td><td></td><td class="s"> my $content = _slurp($file);</td></tr> |
241 | <tr><td class="h"><a name="72"></a>72</td><td></td><td></td><td></td><td></td><td class="s"> return undef unless ref $content;</td></tr> |
242 | <tr><td class="h"><a name="73"></a>73</td><td></td><td></td><td></td><td></td><td class="s"> $$content =~ s/(?:\015{1,2}\012|\015|\012)/\n/gs;</td></tr> |
243 | <tr><td class="h"><a name="74"></a>74</td><td></td><td></td><td></td><td></td><td class="s"> md5hex($$content);</td></tr> |
244 | <tr><td class="h"><a name="75"></a>75</td><td></td><td></td><td></td><td></td><td class="s">}</td></tr> |
245 | <tr><td class="h"><a name="76"></a>76</td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
246 | <tr><td class="h"><a name="77"></a>77</td><td class="c3">1</td><td class="c3"><span title="Avg 3µs">3µs</span></td><td></td><td></td><td class="s">1;</td></tr> |
247 | <tr><td class="s"><a name=""></a> </td><td></td><td></td><td></td><td></td><td class="s"></td></tr> |
248 | <tr><td class="h"><a name="PPI__Util__TRUE"></a></td><td></td><td></td><td></td><td></td><td class="s"><div class="calls"><div class="calls_in"># spent 158µs within PPI::Util::TRUE which was called 279 times, avg 568ns/call: |
249 | # 48 times (25µs+0s) by PPI::Element::next_sibling at <a href="PPI-Element-pm-919-sub.html#341">line 341 of PPI/Element.pm</a>, avg 523ns/call |
250 | # 40 times (23µs+0s) by PPI::Element::next_sibling at <a href="PPI-Element-pm-919-sub.html#347">line 347 of PPI/Element.pm</a>, avg 570ns/call |
251 | # 40 times (22µs+0s) by PPI::Element::next_token at <a href="PPI-Element-pm-919-sub.html#505">line 505 of PPI/Element.pm</a>, avg 545ns/call |
252 | # 32 times (16µs+0s) by PPI::Tokenizer::get_token at <a href="PPI-Tokenizer-pm-1003-sub.html#266">line 266 of PPI/Tokenizer.pm</a>, avg 487ns/call |
253 | # 16 times (10µs+0s) by PPI::Element::first_token at <a href="PPI-Element-pm-919-sub.html#445">line 445 of PPI/Element.pm</a>, avg 631ns/call |
254 | # 16 times (8µs+0s) by Parse::Method::Signatures::tc at <a href="Parse-Method-Signatures-pm-911-sub.html#616">line 616 of Parse/Method/Signatures.pm</a>, avg 506ns/call |
255 | # 8 times (6µs+0s) by PPI::Token::Whitespace::__TOKENIZER__on_line_end at <a href="PPI-Token-Whitespace-pm-924-sub.html#417">line 417 of PPI/Token/Whitespace.pm</a>, avg 713ns/call |
256 | # 8 times (6µs+0s) by PPI::Element::snext_sibling at <a href="PPI-Element-pm-919-sub.html#364">line 364 of PPI/Element.pm</a>, avg 700ns/call |
257 | # 8 times (6µs+0s) by PPI::Tokenizer::get_token at <a href="PPI-Tokenizer-pm-1003-sub.html#287">line 287 of PPI/Tokenizer.pm</a>, avg 688ns/call |
258 | # 8 times (5µs+0s) by PPI::Document::new at <a href="PPI-Document-pm-996-sub.html#231">line 231 of PPI/Document.pm</a>, avg 663ns/call |
259 | # 8 times (5µs+0s) by PPI::Element::next_token at <a href="PPI-Element-pm-919-sub.html#509">line 509 of PPI/Element.pm</a>, avg 600ns/call |
260 | # 8 times (5µs+0s) by Parse::Method::Signatures::_param_typed at <a href="Parse-Method-Signatures-pm-911-sub.html#499">line 499 of Parse/Method/Signatures.pm</a>, avg 588ns/call |
261 | # 8 times (4µs+0s) by PPI::Lexer::_add_element at <a href="PPI-Lexer-pm-1005-sub.html#1446">line 1446 of PPI/Lexer.pm</a>, avg 550ns/call |
262 | # 8 times (4µs+0s) by PPI::Statement::new at <a href="PPI-Statement-pm-969-sub.html#203">line 203 of PPI/Statement.pm</a>, avg 537ns/call |
263 | # 8 times (4µs+0s) by PPI::Lexer::_get_token at <a href="PPI-Lexer-pm-1005-sub.html#1413">line 1413 of PPI/Lexer.pm</a>, avg 462ns/call |
264 | # 8 times (4µs+0s) by PPI::Node::add_element at <a href="PPI-Node-pm-921-sub.html#114">line 114 of PPI/Node.pm</a>, avg 462ns/call |
265 | # 7 times (7µs+0s) by PPI::Token::Whitespace::null at <a href="PPI-Token-Whitespace-pm-924-sub.html#79">line 79 of PPI/Token/Whitespace.pm</a>, avg 1µs/call</div></div>sub PPI::Util::TRUE; # xsub<br /> </td></tr> |
266 | </tbody></table></div> |
267 | |
268 | <script type="text/javascript"> $(document).ready(function() { |
269 | |
270 | $("#subs_table").tablesorter({ |
271 | sortList: [[3,1]], |
272 | headers: { |
273 | 3: { sorter: 'fmt_time' }, |
274 | 4: { sorter: 'fmt_time' } |
275 | } |
276 | }); |
277 | |
278 | } ); </script> |
279 | |
280 | <div class="footer">Report produced by the |
281 | <a href="http://search.cpan.org/dist/Devel-NYTProf/">NYTProf 4.06</a> |
282 | Perl profiler, developed by |
283 | <a href="http://www.linkedin.com/in/timbunce">Tim Bunce</a> and |
284 | <a href="http://code.nytimes.com">Adam Kaplan</a>. |
285 | </div> |
286 | <br /><br /><br /><br /><br /><br /><br /><br /><br /><br /> |
287 | </body></html> |