<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Not this... &#187; perl</title>
	<atom:link href="http://blog.timbunce.org/category/tech/software/perl/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timbunce.org</link>
	<description>Listen. Reflect. Explore. Solve.</description>
	<lastBuildDate>Thu, 24 Dec 2009 23:16:13 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='blog.timbunce.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/eb188a9f7199a98e44133dc454d3873b?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Not this... &#187; perl</title>
		<link>http://blog.timbunce.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://blog.timbunce.org/osd.xml" title="Not this&#8230;" />
	<atom:link rel='hub' href='http://blog.timbunce.org/?pushpress=hub'/>
		<item>
		<title>NYTProf v3 &#8211; Worth the wait!</title>
		<link>http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/</link>
		<comments>http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 23:08:54 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=362</guid>
		<description><![CDATA[After more than six months, and more than a few technical hurdles, NYTProf v3 has been released at last.
In this post I&#8217;ll review the major changes and significant new features.
What&#8217;s new in Devel::NYTProf v3?

Treemap
The first big feature is a visualization of the exclusive time spent in subroutines represented as a treemap:

That&#8217;s a treemap of a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=362&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>After more than six months, and more than a few technical hurdles, NYTProf v3 has been released at last.</p>
<p>In this post I&#8217;ll review the major changes and significant new features.<span id="more-362"></span><br />
<h1>What&#8217;s new in Devel::NYTProf v3?<br />
</h1>
<h2>Treemap</h2>
<p>The first big feature is a visualization of the exclusive time spent in subroutines represented as a <a href="http://en.wikipedia.org/wiki/Treemap">treemap</a>:</p>
<p><img src="http://timbunce.files.wordpress.com/2009/07/filename.png?w=770" alt="filename.png" border="0" width="770" height="550	" /></p>
<p>That&#8217;s a treemap of a profile of perlcritic 1.088. The colors don&#8217;t mean anything. They&#8217;re just used to visually group subroutines in the same package. (I&#8217;m not very happy with the colors but the <a href="http://thejit.org/">JIT toolkit</a> I&#8217;m using doesn&#8217;t make it easy to use an attractive colour range. It interpolates a value in RGB color space. It would be much better to interpolate the value in HSV color space.)</p>
<p>The treemap is interactive! If you click on a square then the treemap is redrawn &#8220;zoomed in&#8221; one package level &#8216;closer&#8217; to the package of the subroutine you clicked on.</p>
<h2>Subroutine Caller Tracking</h2>
<p>The subroutine profiler has been almost completely rewritten, yielding another major new feature. It now finds and records the name of the <em>calling</em> subroutine. (You might have assumed that NYTProf always did that. In fact it <em>guessed</em> based on the calling file and line number, and so was easily confused by nested subroutines and closures.) By properly tracking the calling subroutine NYTProf can now generate a more accurate call graph.</p>
<p>One immediate beneficiary is the nytprofcg utility (contributed by <a href="http://search.cpan.org/~clkao/">Chia-liang Kao</a>). nytprofcg reads NYTProf profile data and generates callgrind data for viewing via <a href="http://kcachegrind.sourceforge.net/html/Home.html">Kcachegrind</a>. The previous guessing behaviour limited the usefulness of nytprofcg. Now it works well, as you can see here: </p>
<p><img src="http://timbunce.files.wordpress.com/2009/07/zz4f06129a.png?w=799&#038;h=562" alt="ZZ4F06129A.png" border="0" width="799" height="562" /></p>
<p>I&#8217;ve not played with it much yet. If you do, <a href="http://groups.google.com/group/develnytprof-dev">let us know</a> how it works out for you!</p>
<p>The subroutine called <code>main::RUNTIME</code> in the image above is the fake name that NYTProf gives to &#8216;caller&#8217; of the main script code. Code run at compile time will have a top-level caller of <code>main::BEGIN</code>.</p>
<h2>BEGIN</h2>
<p>Speaking of <code>BEGIN</code>s, they&#8217;ve always been a problem because there can be many of them in a single package. Each <code>use</code> statement, for example, generates a <code>BEGIN</code> sub that&#8217;s immediately executed then discarded. Previously the data for all those <code>BEGIN</code>s was mashed together and so almost useless.</p>
<p>The NYTProf subroutine profiler now renames <code>BEGIN</code>s by appending <code>@<em>linenumber</em></code> to make them unique. A whole new level of detail is opened up by this change. (This, along with a few other new features, requires perl 5.10.1+ or 5.8.9+.)</p>
<h2>Goto</h2>
<p>NYTProf now handles <code>goto &amp;sub;</code> properly. That tail-call construct is commonly found at the end of <code>AUTOLOAD</code> subroutines&mdash;so it&#8217;s more common than you might think.</p>
<p>The calling and called subroutine call counts and timings are updated correctly. For the call graph, the destination subroutine appears to have been called by the subroutine that called the subroutine that executed the goto. In other words, if A calls B and B does a goto &amp;C, that call to C will show A as the caller. That fits the way goto &amp;sub works, and ensures inclusive and exclusive times make sense.</p>
<h2>Slow Opcode Profiling</h2>
<p>This is another major new feature. NYTProf can now profile the time spent executing certain opcodes (the lowest-level units of execution in the perl interpreter).</p>
<p>I originally envisaged adding the mechanism for opcodes that corresponded to system calls (read, write, mkdir, chdir etc.) and called the feature &#8217;sys ops&#8217;. Then I realised there were other perl opcodes that would be worth profiling. The main two being <code>match</code> (<code>m/.../</code>) and <code>subst</code> (<code>s/.../.../</code>). So now the NYTProf subroutine profiler can now profile time spent in regular expressions!</p>
<p>Here&#8217;s an example:</p>
<p><img src="http://timbunce.files.wordpress.com/2009/08/zz1f7ce510.png?w=755&#038;h=235" alt="ZZ1F7CE510.png" border="0" width="755" height="235" /></p>
<p>The opcodes are given pseudo-subroutine names <em>in the package that invoked the opcode</em> with &#8220;<code>CORE:</code>&#8221; prepended to the opcode name. In the example above you can see  two instances of <code>CORE:match</code>. One accounting for matches performed in the <code>main::</code> package, and another accounting for matches performed in the <code>File::Find::</code> package. (They&#8217;re marked &#8216;xsub&#8217; above but I&#8217;ve changed that to &#8216;opcode&#8217; now.)</p>
<p>Profiling of &#8217;slowops&#8217;, as I&#8217;ve called them, is controlled by the <code>slowops=N</code> option. A value of 0 turns off slowop profiling. A value of 2 (the default) gives the behaviour shown above, with opcodes called in different packages being accounted for separately. A value of 1 will put all the slowops into a single package named &#8220;<code>CORE::</code>&#8220;.</p>
<h2>GraphViz</h2>
<p>Another spin-off from the work on call graphs: NYTProf now also outputs representations of the subroutine call graph as GraphViz <a href="http://en.wikipedia.org/wiki/DOT_language">dot language</a> files. These can be rendered by<br />
<a href="http://www.graphviz.org/">a variety of viewers</a>. I use <a href="http://www.pixelglow.com/graphviz/">GraphViz by pixelglow</a>.</p>
<p>Here&#8217;s a simple example showing the calling relationship between packages in a little demo script I use for testing:</p>
<p><img src="http://timbunce.files.wordpress.com/2009/08/subs-callgraph.png?w=514&#038;h=282" alt="subs-callgraph.png" border="0" width="514" height="282" /></p>
<p>The dot file for that inter-package view is available as a link on the top-level index page of the report.</p>
<p>On the individual report pages for each source file there&#8217;s a link to another dot file. This one shows the calls into, out of, and between the subroutines in package(s) in that source file. For example, here&#8217;s the call graph for the subs in the File::Find module:</p>
<p><img src="http://timbunce.files.wordpress.com/2009/08/call-graphviz-file-find-pm.png?w=682&#038;h=365" alt="call-graphviz-File-Find-pm.png" border="0" width="682" height="365" /></p>
<p>There are many things that could be improved with that graph, such as adding call counts. Overall though, I&#8217;m pretty happy with it.</p>
<h2>Report Format Changes</h2>
<p>There have been some changes to the main report columns:</p>
<p><img src="http://timbunce.files.wordpress.com/2009/08/zz5dc6382a.png" alt="ZZ5DC6382A.png" border="0"/></p>
<p>There are two new columns, &#8220;Calls&#8221; and &#8220;Time in Subs&#8221;. They show the number of subroutine calls executed on that line, and the total time spent in those subroutines due to those calls. Both are color coded, <em>relative to the other values in the same columns</em>, using the same <a href="http://en.wikipedia.org/wiki/Median_absolute_deviation">Median Average Deviation</a> that&#8217;s used elsewhere.</p>
<p>To make room for the new columns, the column showing the average statement execution time has been removed (it wasn&#8217;t much use anyway) and the column headings tightened up. The average value, if you&#8217;re interested, is available as a tool-tip, as shown above.</p>
<h2>New Options</h2>
<p>A few new options have been added, including:</p>
<ul>
<li><code>sigexit=<em>S</em> </code> Some signals will abort a process leaving a corrupt profile data file. The <code>sigexit</code> option can be used to tell NYTProf to catch those signals and close the profile cleanly before exiting.
</li>
<li><code>forkdepth=<em>N</em> </code>When a process being profiled is forked the child process is also profiled. The <code>forkdepth=N</code> option can be used to limit the number of generations that are profiled. The default is -1 (all generations). A value of 0 effectively disables profiling of child processes.
</li>
<li><code>log=<em>F</em> </code>If you enable NYTProf trace output, via the <code>trace=<em>N</em></code> option, it&#8217;s normally written to stderr. The <code>log=<em>F</em> </code> can be used to write the log to a specific file instead.
</li>
</ul>
<h2>nytprofmerge</h2>
<p>As I mentioned above, when a profiled process forks, the child is also profiled, with the profile being written to a new file. So processes which have many children, like mod_perl, end up with many profile data files. Naturally many people have expressed a wish for NYTProf to be able to merge multiple profiles into a single report. Sadly no one has stepped up actually do the work, till now.</p>
<p><a href="http://www.ccl4.org/~nick/">Nicholas Clark</a>, who contributed the great <a href="http://blog.timbunce.org/2008/10/03/nytprof-204-gives-you-90-smaller-data-files/">zip compression</a> for v2.04 (and a major contributor to the perl core and pumpkin for the 5.8.2+ releases) has come up trumps again. NYTProf v3 includes a new nytprofmerge utility that&#8217;ll read multiple profiles and write out a new, merged, profile. It&#8217;s very new, and somewhat experimental, but answers a very real need. Give it a whirl and <a href="http://groups.google.com/group/develnytprof-dev">let us know</a> how it goes. </p>
<h2>Screencast</h2>
<p>I gave a talk on Devel::NYTProf at the (excellent) <a href="http://conferences.yapceurope.org/ipw2009">Italian Perl Workshop</a> in October. I covered both the features in version 3 and the phased approach I take to optimizing perl code. You can <a href="http://blip.tv/file/2840795">watch the screencast</a>.</p>
<h2>And finally</h2>
<p>For more information on the changes in Devel::NYTProf v3 you can <a href="http://search.cpan.org/~timb/Devel-NYTProf-3.00/Changes">read the Changes file</a>.</p>
<p>It&#8217;s <a href="http://en.wikipedia.org/wiki/Christmas_Eve">Christmas Eve</a> here in Ireland. After days, and nights, of hard frost the countryside is spectacularly encased in tiny ice crystals sparking in the bright sunshine. I&#8217;m delighted to have stumbled into working on NYTProf. It&#8217;s a great project at the intersection of two of my professional passions: performance and visualization. And I&#8217;m delighted to give you NYTProf v3 in time for <em>this</em> Christmas.</p>
<p>Enjoy!</p>
<p>Tim.</p>
<br />Posted in perl Tagged: nytprof <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/362/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/362/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/362/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=362&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/07/filename.png" medium="image">
			<media:title type="html">filename.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/07/zz4f06129a.png" medium="image">
			<media:title type="html">ZZ4F06129A.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/08/zz1f7ce510.png" medium="image">
			<media:title type="html">ZZ1F7CE510.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/08/subs-callgraph.png" medium="image">
			<media:title type="html">subs-callgraph.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/08/call-graphviz-file-find-pm.png" medium="image">
			<media:title type="html">call-graphviz-File-Find-pm.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/08/zz5dc6382a.png" medium="image">
			<media:title type="html">ZZ5DC6382A.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Wishlist of PL/Perl Enhancements for PostgreSQL 8.5</title>
		<link>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/</link>
		<comments>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/#comments</comments>
		<pubDate>Mon, 05 Oct 2009 22:00:42 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[plperl]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=344</guid>
		<description><![CDATA[I&#8217;m working with PostgreSQL for my day job, and liking it.
We&#8217;re fairly heavy users of stored procedures implemented in PL/Perl, with ~10,000 lines in ~100 functions (some of which have bloated to painful proportions). This creates some interesting issues and challenges for us.
There&#8217;s a window of opportunity now to make improvements to PL/Perl for PostgreSQL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=344&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working with PostgreSQL for my day job, and liking it.</p>
<p>We&#8217;re fairly heavy users of stored procedures implemented in PL/Perl, with ~10,000 lines in ~100 functions (some of which have bloated to painful proportions). This creates some interesting issues and challenges for us.</p>
<p>There&#8217;s a window of opportunity <em>now</em> to make improvements to PL/Perl for PostgreSQL 8.5. I&#8217;m planning to work with <a href="http://developer.postgresql.org/~adunstan/">Andrew Dunstan</a> to agree on a set of changes and develop the patches.</p>
<p>As a first step along that road I want to map out here the changes I&#8217;m thinking of and to ask for comments and suggestions.</p>
<p><span id="more-344"></span><br />
<h2>Goals:</h2>
<ul>
<li>Enable modular programming by pre-loading user libraries.</li>
<li>Soften the hard choice between plperl and <a href="http://www.postgresql.org/docs/8.4/interactive/plperl-trusted.html">plperlu</a>, so there&#8217;s less reason to &#8220;give up&#8221; and use plperlu.</li>
<li>Improve performance.</li>
<li>Improve flexibility for future changes.</li>
<li>Enable use of tracing/debugging tools.</li>
</ul>
<h2>Specific Proposals:</h2>
<ol>
<li><strong>Enable configuration of perl at initialization</strong></li>
<p>Add ability to specify in postgresql.conf some code to be run when a perl interpreter is initialized. For example:</p>
<p><code>plperl.at_init_do = 'use lib qw(/path/to/mylib); use MyPlPerlUtils; use List::Util qw(sum);'</code></p>
<li><strong>Configure extra items to be shared with the Safe compartment</strong></li>
<p>The Safe compartment used for plperl functions can&#8217;t access any namespace outside the compartment. So, by default, any subroutines defined by libraries loaded via <code>plperl.at_init_do</code> won&#8217;t be callable from plperl functions.</p>
<p>Some mechanism is needed to specify which extra subroutines, and/or variables, should be shared with the Safe compartment. For example:</p>
<p><code>plperl.safe_share = '$foo, myfunc, sum'</code></p>
<li><strong>Permit some more opcodes in the Safe compartment</strong></li>
<p>I&#8217;d like to add the following opcodes to the set of opcodes permitted in the Safe compartment: <code>caller, dbstate, tms</code>.</p>
<li><strong>Execute END blocks at process end</strong></li>
<p>Currently PostgreSQL doesn&#8217;t execute END blocks when the backend postgres process exits (oddly, it actually executes them immediately after initializing the interpreter). Fixing that would greatly simplify use of tools like NYTProf that need to know when the interpreter is exiting. <em>Updated: used to say &#8220;at server shutdown&#8221; which was wrong.</em></p>
<li><strong>Name PL/Perl functions</strong></li>
<p>Currently PL/Perl functions are compiled as anonymous subroutines. Applying the same technique as the <a href="http://search.cpan.org/perldoc?Sub::Name">Sub::Name</a> module would allow them have &#8216;more useful&#8217; names than the current &#8216;__ANON__&#8217;.</p>
<p>For a PL/Perl function called &#8220;foo&#8221;, a minimal implementation would use a name like &#8220;foo__id54321&#8243; where 54321 is the oid of the function. This avoids having to deal with polymorphic functions (where multiple functions have the same name but different arguments). </p>
<p>The names won&#8217;t enable inter-function calling and may not even be installed in the symbol table. They&#8217;re just to improve error messages and to enable use of tools like <a href="http://code.google.com/p/perl-devel-nytprof/source/browse/trunk/lib/Devel/NYTProf/PgPLPerl.pm">Devel::NYTProf:: PgPLPerl</a> (as yet unreleased).</p>
<li><strong>Miscellaneous updates to the PL/Perl documentation</strong></li>
<p>To document the new functionality and expand/update the related text.</p>
<li><strong>Improve Performance</strong></li>
<p>It seems likely that there&#8217;s room for improvement. Some code profiling is needed first, though, so I&#8217;ll leave this one vague for now.</p>
</ol>
<p>Any comments on the above?<br />
Anything you&#8217;d like to add?</p>
<p>If so, speak up, time is short!<br />
<hr />
<div style="font-size:-2px;">
<h2>Footnote</h2>
<p>For completeness I&#8217;ll mention that I was thinking of adding a way to permit extra opcodes (plperl.safe_permit=&#8217;caller&#8217;) and a way to use a subclass of the Safe module (plperl.safe_class=&#8217;MySafe&#8217;). I dropped them because I felt the risks of subtle security issues outweighed the benefits. Any requirements for which these proposals seem like a good fit can also be met via <code>plperl.at_init_do</code> and <code>plperl.safe_share</code>.</div></p>
<br />Posted in perl Tagged: plperl, postgresql <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/344/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/344/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/344/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=344&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Perl Myths and Mongers in Dublin</title>
		<link>http://blog.timbunce.org/2009/09/22/perl-myths-and-mongers-in-dublin/</link>
		<comments>http://blog.timbunce.org/2009/09/22/perl-myths-and-mongers-in-dublin/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 21:41:26 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[ireland]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[myths]]></category>
		<category><![CDATA[ossbarcamp]]></category>
		<category><![CDATA[perl6]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=339</guid>
		<description><![CDATA[Last weekend I went up to Dublin to speak at OSSBarcamp. I took the train from Limerick on Friday so I&#8217;d already be in Dublin the following morning, without having to get up at the crack of dawn.
Dublin.pm
Aidan Kehoe and I had a very small but interesting Dublin.pm meeting that night. Their first since 2004! [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=339&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Last weekend I went up to Dublin to speak at <a href="http://www.ossbarcamp.com/">OSSBarcamp</a>. I took the train from Limerick on Friday so I&#8217;d already be in Dublin the following morning, without having to get up at the crack of dawn.</p>
<h2>Dublin.pm</h2>
<p>Aidan Kehoe and I had a very small but interesting Dublin.pm meeting that night. Their first since 2004! Our wide-ranging discussions that night included me trying to understand what led Dublin.pm to flounder instead of flourish. I think a key factor was the (implicit?) expectation that members should make technical presentations.</p>
<p>Living in the west of Ireland there aren&#8217;t enough local Perl users (that I&#8217;ve found so far) to have a viable Perl Mongers group. So I setup the <a href="http://www.meetup.com/limerick-open-source/">Limerick Open Source</a> meetup instead.</p>
<p>Here&#8217;s what worked for us: We sit around in a quiet comfy hotel bar and chat. Naturally the chat tends towards the technical, and laptops are produced and turned around to illustrate a point or show results of a search, a chunk of video etc. There&#8217;s no set agenda, no declared topics, and no presentations. And yet, I think it&#8217;s fair to say, that everyone who&#8217;s come along has learnt interesting (albeit random) stuff.</p>
<p>I&#8217;d like to hear from perl mongers, in groups of all sizes, what kinds of balance between the social and technical aspects of Perl Mongers meetings works (or doesn&#8217;t work) for you.</p>
<h2>OSSBarcamp</h2>
<p>At OSSBarcamp I gave a ~15 minute &#8216;lightning talk&#8217; on Devel::NYTProf in the morning, and a ~50 minute talk on Perl Myths in the afternoon.</p>
<p>The Perl Myths talk was a major update to my <a href="http://www.slideshare.net/Tim.Bunce/perl-myths-200802">previous version</a>, now over 18 months old, incorporating lots of updated graphs and <a href="http://blog.timbunce.org/2009/08/13/help-me-update-my-perl-myths-talk-for-2009/">other fresh information</a>.</p>
<p>There is so much happy vibrant productive life in the Perl community that updating the presentation has been lovely experience. I keep having to revise the numbers on the slides upwards. There are lots of great graphs and they&#8217;re all going upwards too! (Many thanks to <a href="http://barbie.missbarbell.co.uk/">Barbie</a> for the great new graphs of CPAN stats.)</p>
<p>I&#8217;ve put a PDF of the slides, with notes, <a href="http://www.slideshare.net/Tim.Bunce/perl-myths-200909">on slideshare</a>. Best viewed full-screen or downloaded.</p>
<p>I made a screencast but I think I&#8217;ll hang on to that until after I give the same talk, updated again, at the <a href="http://conferences.yapceurope.org/ipw2009/">Italian Perl Workshop</a> (IPW09) in Pisa in October &mdash; I&#8217;m really looking forward to that! I&#8217;ll make another screencast there and decide then which to upload.</p>
<p>After OSSBarcamp last week, and before IPW09 in late October, I&#8217;ll be flying to Moscow, visa permitting, to give a talk at the <a href="http://www.highload.ru/">HighLoad++</a> (<a href="http://translate.google.com.au/translate?u=http%3A%2F%2Fwww.highload.ru&amp;sl=ru&amp;tl=en&amp;hl=en&amp;ie=UTF-8">translated</a>) conference. I&#8217;ve never been to Russia before so that&#8217;s going to be an amazing experience!</p>
<br />Posted in ireland, perl Tagged: conference, graphs, jobs, language, myths, ossbarcamp, perl6, presentation <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/339/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/339/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/339/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=339&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/09/22/perl-myths-and-mongers-in-dublin/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Perl in five sentences</title>
		<link>http://blog.timbunce.org/2009/09/10/perl-in-five-sentences/</link>
		<comments>http://blog.timbunce.org/2009/09/10/perl-in-five-sentences/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 12:00:54 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[myths]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=326</guid>
		<description><![CDATA[I just added a concluding slide to my updated Perl Myths talk. Having comprehensively debunked some myths with hard facts about perl and its ecosystem, I wanted to end with a slide that summarized some truths.
I liked the slide text so much I wanted to share it with you:



Perl:
has a massive library of reusable code
has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=326&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I just added a concluding slide to my updated Perl Myths talk. Having comprehensively debunked some myths with hard facts about perl and its ecosystem, I wanted to end with a slide that summarized some truths.</p>
<p>I liked the slide text so much I wanted to share it with you:</p>
<hr />
<p><strong><br />
<blockquote>
Perl:</p>
<p>has a massive library of reusable code<br />
has a culture of best practice and testing<br />
has a happy welcoming growing community<br />
has a great future in Perl 5 and Perl 6<br />
is a great language <em>for getting your job done</em><br />
&nbsp;&nbsp;&nbsp;&nbsp;for the last 20 years, and the next 20!</p></blockquote>
<p></strong></p>
<p>&nbsp;</p>
<hr />
<p>It would make more sense after seeing the talk, but I think it stands well on its own as a summary of Perl.</p>
<p></p>
<br />Posted in perl Tagged: myths, presentation <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=326&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/09/10/perl-in-five-sentences/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Is your Perl community visible?</title>
		<link>http://blog.timbunce.org/2009/09/04/is-your-perl-community-visible/</link>
		<comments>http://blog.timbunce.org/2009/09/04/is-your-perl-community-visible/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 12:44:50 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[community]]></category>
		<category><![CDATA[graphs]]></category>
		<category><![CDATA[trends]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=316</guid>
		<description><![CDATA[As I mentioned recently, I&#8217;m working on an update to my Perl Myths talk. (Which is really a review of the state of the art, state of the community, resources, and best practices. You could even call it marketing.)
In recent months, and especially while researching for this update, it&#8217;s become clear to me that the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=316&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>As I mentioned <a href="http://blog.timbunce.org/2009/08/13/help-me-update-my-perl-myths-talk-for-2009/">recently</a>, I&#8217;m working on an update to my Perl Myths talk. (Which is really a review of the state of the art, state of the community, resources, and best practices. You could even call it marketing.)</p>
<p>In recent months, and especially while researching for this update, it&#8217;s become clear to me that the Perl community is both functioning well and growing more conscious of its own role and value.</p>
<p>But are the various components of &#8220;the community&#8221; sufficiently visible?<span id="more-316"></span></p>
<p>You&#8217;ll often hear expressions like CPAN is the &#8220;jewel in the crown&#8221; of Perl. To the extent that&#8217;s true, it&#8217;s the Perl community that we have to thank. CPAN feeds the community, and the community feeds CPAN &#8211; at an <a href="http://stats.cpantesters.org/trends.html">ever increasing rate</a>. <em>(Those graphs currently include the current incomplete month, so often show a sudden but unrepresentative drop in the final value. That&#8217;s being fixed.)</em></p>
<p>When I read stories from those new to the community <a href="http://use.perl.org/~redspike/journal/39576">like this</a>, or <a href="http://thejoysofcomputing.wordpress.com/2009/09/02/why-i-love-perl-already/">this</a>, I think Larry&#8217;s <a href="http://use.perl.org/article.pl?sid=00/07/19/161217">vision</a> expressed in 2000 (and <a href="http://www.oreillynet.com/pub/wlg/5091">echoed</a> in 2004 by Nat) of &#8220;the community&#8217;s rewrite of the community&#8221; has come to pass.</p>
<p>But for every user in the perl community there are countless more perl users outside it. Unaware of other perl users near them, either physically or <a href="http://www.irc.perl.org/">virtually</a>. We need to find ways of reaching out to those users and encouraging them to join our various communities (Perl Mongers, PerlMonks, IRC channels etc. etc.).</p>
<h2>On The Map?</h2>
<p>So, back to my Perl Myths talk&#8230; To help convey the scale and geographic spread of the perl community I&#8217;m including <a href="http://www.pm.org/groups/map.html">this map</a> of the locations of Perl Mongers groups:</p>
<p><img src="http://timbunce.files.wordpress.com/2009/09/zz3d4a76b3.png?w=639&#038;h=426" alt="Global map of perl monger group locations" border="0" width="639" height="426" /></p>
<p>When I zoomed in on Europe I could see that there was no marker for the <a href="http://dublin.pm.org/">Dublin Perl Mongers</a>. Now I know that the Dublin group is <a href="http://mail.pm.org/pipermail/dublin-pm/">barely</a> active, but it is alive and should be on the map. So that got me thinking &#8220;how many more Perl Monger groups are alive but not on the map?&#8221;.</p>
<p>Please go check the map for any perl monger groups <em>you know of</em> and, if you can&#8217;t find them, email the admin for the group (you can find the email address at http://www.pm.org) and ask them to update their details to include the location. Also, if possible, email the approximate location to <a href="http://www.pm.org/contact/index.html">pm.org</a> yourself so they can be added to the map ASAP. (I&#8217;d be especially grateful if more markers could be added for groups in sparse areas of the map!)</p>
<h2>In The Calendar?</h2>
<p>To help convey the scale of <em>activity</em> within the community I include this graph of conferences, workshops, and hackathons (<em>thanks to BooK for updating it for me</em>):</p>
<p><img src="http://act.mongueurs.net/act-conferences.png" alt="graph of perl conferences, workshops, and hackathons by year" border="0" width="639" height="426" /></p>
<p>Notice the dip in &#8220;Other conferences&#8221; in 2009? Perhaps the rise in 2008 was an aberration, and 2009 has returned to the underlying trend. Or perhaps some smaller events, like workshops and hackathons, might have been missed, in the same way that Perl Monger groups might not be &#8216;on the map&#8217;.</p>
<p>So I&#8217;m looking for help in checking that all perl workshops and hackathons in 2009 have been noted.</p>
<p>The underlying data for the graph can be found in a YAML file <a href="http://www.yapceurope.org/events/conferences.yml">here</a>. Or, instead of rummaging though a YAML file, you could look at <a href="http://www.google.com/calendar/embed?src=ngctmrd1cac35061mrjt3hpgng%40group.calendar.google.com">this calendar</a>. I&#8217;ve already checked that all entries matching &#8216;workshop&#8217; or &#8216;hackathon&#8217; are in the YAML file. What I&#8217;d like <em>you</em> to do, is check that any workshops or hackathons that <em>you&#8217;re aware of</em> are in the calendar. If not, let me know.</p>
<p>Thanks!</p>
<br />Posted in life, perl Tagged: community, graphs, trends <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/316/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/316/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/316/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=316&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/09/04/is-your-perl-community-visible/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/09/zz3d4a76b3.png" medium="image">
			<media:title type="html">Global map of perl monger group locations</media:title>
		</media:content>

		<media:content url="http://act.mongueurs.net/act-conferences.png" medium="image">
			<media:title type="html">graph of perl conferences, workshops, and hackathons by year</media:title>
		</media:content>
	</item>
		<item>
		<title>Help me update my Perl Myths talk for 2009</title>
		<link>http://blog.timbunce.org/2009/08/13/help-me-update-my-perl-myths-talk-for-2009/</link>
		<comments>http://blog.timbunce.org/2009/08/13/help-me-update-my-perl-myths-talk-for-2009/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 15:21:18 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[ireland]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[myths]]></category>
		<category><![CDATA[perl6]]></category>
		<category><![CDATA[presentation]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=306</guid>
		<description><![CDATA[I&#8217;m going to be speaking at the OSS BarCamp in Dublin in September. Given the likely audience I think my Perl Myths talk would be a good fit.
It needs updating though, and that&#8217;s where you can help&#8230;
It&#8217;s a strongly fact base talk with lots of graphs, numbers, and references. A lot has happened in the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=306&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m going to be speaking at the <a href="http://www.ossbarcamp.com">OSS BarCamp</a> in Dublin in September. Given the likely audience I think my <a href="http://blog.timbunce.org/2008/03/08/perl-myths/">Perl Myths talk</a> would be a good fit.</p>
<p>It needs updating though, and that&#8217;s where <em>you can help</em>&#8230;<span id="more-306"></span></p>
<p>It&#8217;s a strongly fact base talk with lots of graphs, numbers, and references. A <em>lot</em> has happened in the Perl community since I wrote the talk over 18 months ago!</p>
<p>Lots of the information needs to be checked and updated. The <a href="http://blog.timbunce.org/2008/02/12/comparative-language-job-trend-graphs/">jobs graphs are easy</a>, as are the basic CPAN numbers.</p>
<p>I&#8217;d like to get updated versions of: the graph of CPAN uploads (slide 23), test counts for perl 5.10.1 (slide 44), the graph of cpan-testers reports (slide 47).</p>
<p>One item that&#8217;s not in the slides, which were written in Feb 2008, but is in <a href="http://blip.tv/file/1150746">the screencast</a> made later at OSCON (at 7:00) is the statement that &#8220;<em>One quarter of all CPAN distributions have been updated in the last 4 months! Half of all in the last 17 months!</em>&#8221; That&#8217;s an impressive and important statistic but it need updating. I think I got that from Schwern&#8217;s excellent &#8220;<a href="http://use.perl.org/~schwern/journal/36705">Perl is unDead</a>&#8221; talk, but I don&#8217;t know how he got the figures or, more importantly, how to update them. (And schwern.org seems down so I can&#8217;t get the <a href="http://schwern.org/~schwern/talks/Perl%20is%20unDead%20-%20YAPC-NA-2008.pdf">slides</a>.)</p>
<p>At OSCON I also talked about myths relating to Perl 6 (again, not in the old slides, but starting at 19:20 in the <a href="http://blip.tv/file/1150746">screencast</a>). I&#8217;d like to cover Perl 6 when I talk in Dublin in September, but the status of Parrot and Perl 6 has changed in the last 18 months even more than Perl 5. So I need help with good sources of hard data for Parrot and Perl 6, similar to what I have in the screencast but updated.</p>
<p>More generally, I&#8217;m also looking for new sources of information &mdash; hard data about the vigourous health of perl and its community. Have you seen any relevant talks/slides or blog posts you can recommend?</p>
<p>Can you help with any of the above?</p>
<p>Thank you in advance!</p>
<br />Posted in ireland, perl Tagged: myths, perl, perl6, presentation <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/306/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/306/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/306/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=306&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/08/13/help-me-update-my-perl-myths-talk-for-2009/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>NYTProf v3 &#8211; a sneak peak</title>
		<link>http://blog.timbunce.org/2009/08/07/nytprof-v3-a-sneak-peak/</link>
		<comments>http://blog.timbunce.org/2009/08/07/nytprof-v3-a-sneak-peak/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 02:12:49 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[oscon]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slideshare]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=301</guid>
		<description><![CDATA[I&#8217;ve had a great week at OSCON. The talks are excellent but the real value is in the relationships formed and renewed in the &#8220;hallway track&#8221;. I&#8217;m honoured and humbled to be able to call many great people my friends.
My talk on Devel::NYTProf seemed to go well. This year I covered not just NYTProf and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=301&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had a great week at OSCON. The talks are excellent but the real value is in the relationships formed and renewed in the &#8220;hallway track&#8221;. I&#8217;m honoured and humbled to be able to call many great people my friends.</p>
<p>My <a href="http://en.oreilly.com/oscon2009/public/schedule/detail/7941">talk on Devel::NYTProf</a> seemed to go well. This year I covered not just NYTProf and the new features in v3 (not yet released) but also added a section on how to use NYTProf to optimize your perl code.</p>
<p>Here&#8217;s a quick summary, with links to the slides and screen-cast, and outline what&#8217;s still to be done before v3 gets released (getting closer by the day).<span id="more-301"></span>The first two-thirds of the talk covered general profiling topics and an overview of NYTProf v3. This was an updated and compressed version of the talk I gave last year.</p>
<p>The final third covered optimization techniques.</p>
<p>I began with stern warning against optimization unless there&#8217;s a clear need, followed by a selection of quotes, among which is the well known classic from <a href="http://en.wikipedia.org/wiki/Donald_Knuth">Donald Knuth</a>: &#8220;premature optimization is the root of all evil&#8221;. What few people remember is that that&#8217;s just a fragment of a more balanced statement:</p>
<blockquote><p><em>“We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. <strong>Yet we should not pass up our opportunities in that critical 3%.</strong>”</em></p></blockquote>
<p>After getting an implicit nod from Donald I quoted <a href="http://en.wikipedia.org/wiki/Rob_Pike">Rob Pike</a> on the importance of measurement:</p>
<blockquote><p><em>“Bottlenecks occur in surprising places, so don&#8217;t try to second guess and put in a speed hack until you have </em>proven<em> that&#8217;s where the bottleneck is.”</em></p></blockquote>
<p>Then I outlined the sequence of steps I usually take when performance profiling and optimizing code. These were grouped into three phases: &#8220;Low Hanging Fruit&#8221;, &#8220;Deeper Changes&#8221;, and &#8220;Structural Changes&#8221;.</p>
<p>I&#8217;ve generated a <a href="http://assets.en.oreilly.com/1/event/27/State-of-the-art%20Profiling%20with%20Devel__NYTProf%20Presentation.pdf">PDF of the slides</a> and made it <a href="http://www.slideshare.net/Tim.Bunce/develnytprof-200907">available on slideshare.net</a>. I&#8217;ve also uploaded <a href="http://blip.tv/file/2396942">the 45 minute screencast</a> to <a href="http://timbunce.blip.tv/">my blip.tv channel</a>.</p>
<p>Let me know if you find them useful.</p>
<hr />
p.s. This was originally a large post highlighting features of NYTProf v3. I hate talking about vapourware and with every day that passes the code is getting closer to being ready. In the end I decided to split the post in two. The shiny goodness in v3 will get its own blog post when it&#8217;s released. Meanwhile the slides and screencast will give you a sneak peek.</p>
<br />Posted in perl Tagged: conference, nytprof, oscon, presentation, slideshare, video <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/301/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/301/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/301/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=301&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/08/07/nytprof-v3-a-sneak-peak/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Unattributed copying of perl blog content via Planet Perl</title>
		<link>http://blog.timbunce.org/2009/06/15/unattributed-copying-of-perl-blog-content-via-planet-perl/</link>
		<comments>http://blog.timbunce.org/2009/06/15/unattributed-copying-of-perl-blog-content-via-planet-perl/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 09:22:38 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[license]]></category>
		<category><![CDATA[perl blogs]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=282</guid>
		<description><![CDATA[I recall other bloggers complaining of unattributed redistribution of their work. Now a site called rapid-dev.net has started redistributing Plant Perl posts, including mine, with an advert at the top.
I wouldn&#8217;t mind if the page had clear attribution, but it doesn&#8217;t. In fact, at the bottom it says &#8220;Author: hoanatwho&#8221;.
That doesn&#8217;t feel right. Especially as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=282&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I recall other bloggers complaining of unattributed redistribution of their work. Now a site called rapid-dev.net has started redistributing Plant Perl posts, including mine, with an advert at the top.</p>
<p>I wouldn&#8217;t mind if the page had clear attribution, but it doesn&#8217;t. In fact, at the bottom it says &#8220;Author: hoanatwho&#8221;.</p>
<p>That doesn&#8217;t feel right. Especially as many of my posts, and probably many others from Planet Perl, use the first-person pronoun &#8220;I&#8221;.</p>
<p>Why does this matter? A couple of months ago Merlin Mann wrote a long but <a href="http://www.43folders.com/2009/04/10/free-me">excellent piece</a> that explains why <em>far</em> better than I could.</p>
<blockquote><p><em>Nobody but me is allowed to decide why I make things. And — if and when I choose to give away the things that I make — nobody but me is allowed to define how or where I’ll do it. I am independent.</em></p></blockquote>
<p>Merlin discusses, with his typical style, the motivations of those who make their work available for free, and the perils of presuming to understand their motives. Although written mostly about bloggers it seems very applicable to authors of Open Source software. For me it echoes how I feel about coding and, to an extent, the freedom that Perl give me to express my thoughts.</p>
<p>If you have a blog I recommend you at least make the licence for reuse clear. <a href="http://blog.timbunce.org">My blog</a> has a &#8220;Terms of Use&#8221; link in the sidebar that refers to <a href="http://creativecommons.org/">Creative Commons</a> &#8220;Attribution-Noncommercial-Share Alike 3.0&#8243; <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/">license</a>.</p>
<p>Looking at the <a href="http://planet.perl.org/">Planet Perl page</a> I see it has no licence. Perhaps that should be fixed &mdash; even if only to say that the license of the feeds being aggregated must be respected.</p>
<br />Posted in life, perl, tech Tagged: license, perl blogs <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/282/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/282/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/282/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=282&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/06/15/unattributed-copying-of-perl-blog-content-via-planet-perl/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Has NYTProf helped you? Tell me how&#8230;</title>
		<link>http://blog.timbunce.org/2009/06/05/has-nytprof-helped-you-tell-me-how/</link>
		<comments>http://blog.timbunce.org/2009/06/05/has-nytprof-helped-you-tell-me-how/#comments</comments>
		<pubDate>Fri, 05 Jun 2009 21:24:06 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[oscon]]></category>
		<category><![CDATA[oscon2009]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=278</guid>
		<description><![CDATA[At OSCON this year1 I&#8217;m giving a &#8220;State-of-the-art Profiling with Devel::NYTProf&#8221; talk. It&#8217;ll be an update of the one I gave last year, including coverage of new features added since then (including, hopefully, two significant new features that are in development).
This year I&#8217;d like to spend some time talking about how interpret the raw information [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=278&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>At OSCON this year<sup><a href="#1">1</a></sup> I&#8217;m giving a &#8220;State-of-the-art Profiling with Devel::NYTProf&#8221; <a href="http://en.oreilly.com/oscon2009/public/schedule/detail/7941">talk</a>. It&#8217;ll be an update of the one I gave last year, including coverage of new features added since then (including, hopefully, two significant new features that are in development).</p>
<p>This year I&#8217;d like to spend some time talking about how interpret the raw information and using it to guide code changes. Approaches like common sub-expression elimination and moving invariant code out of loops are straight-forward. They&#8217;re &#8216;low hanging fruit&#8217; with no API changes involved. Good for a first-pass through the code.</p>
<p>Moving loops down into lower-level code is an example of a deeper change I&#8217;ve found useful. There are many more. I&#8217;d like to collect them to add to the talk and the NYTProf documentation.</p>
<p>So here&#8217;s a question for you: after looking at the NYTProf report, how did <em>you</em> identify what you needed to do to <em>fix</em> the problems?</p>
<p>I&#8217;m interested in your experiences. How you used NYTProf, how you interpreted the raw information NYTProf presented, and then, critically, how you decided what code changes to make to improve performance. What worked, what didn&#8217;t. The practice, not the theory. </p>
<p>Could you to take a moment to think back over the times you&#8217;ve used NYTProf, the testing strategy you&#8217;ve used, and the code changes you&#8217;ve made as a result? Ideally go back and review the diffs and commit comments.</p>
<p>Then send me an email &#8212; <em>tell me your story</em>!</p>
<p>The more detail the better! Ideally with actual code (or pseudo-code) snippets<sup><a href="#2">2</a></sup>.</p>
<hr />
<ol>
<li><a name="1"></a>OSCON is in San Jose this year, July 20-24th. You can use the code &#8216;os09fos&#8217; to get a 20% discount.
</li>
<li><a name="2"></a>Annotated diff&#8217;s would be greatly appreciated. I&#8217;ll give credit for any examples used, naturally, and I&#8217;ll happily anonymize any code snippets that aren&#8217;t open source.
</li>
</ol>
<br />Posted in perl Tagged: nytprof, oscon, oscon2009, perl <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/278/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/278/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/278/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=278&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/06/05/has-nytprof-helped-you-tell-me-how/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Thanks, Iron Man, for the good excuse to perl blog</title>
		<link>http://blog.timbunce.org/2009/05/10/thanks-iron-man-for-the-good-excuse-to-perl-blog/</link>
		<comments>http://blog.timbunce.org/2009/05/10/thanks-iron-man-for-the-good-excuse-to-perl-blog/#comments</comments>
		<pubDate>Sun, 10 May 2009 22:23:25 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[perl blogs]]></category>
		<category><![CDATA[perl programming]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=268</guid>
		<description><![CDATA[I&#8217;ve been thinking that I haven&#8217;t blogged much lately. Assorted half-baked ideas would cross my mind and then evaporate before I&#8217;d find the time, or motivation, to actually start writing.
The folks at the Enlightened Perl Organisation have solved the motivation problem by announcing the Iron Man Blogging Challenge: in short, &#8220;maintain a rolling frequency of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=268&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking that I haven&#8217;t blogged much lately. Assorted half-baked ideas would cross my mind and then evaporate before I&#8217;d find the time, or motivation, to actually start writing.</p>
<p>The folks at the <a href="http://www.enlightenedperl.org">Enlightened Perl Organisation</a> have solved the motivation problem by announcing the <a href="http://www.enlightenedperl.org/ironman.html">Iron Man Blogging Challenge</a>: in short, &#8220;<em>maintain a rolling frequency of 4 posts every 32 days, with no more than 10 days between posts</em>&#8220;.</p>
<p>So about one post a week. I can aim for that!</p>
<p>Can you? &#8220;<em>The rules are very simple: you blog, about Perl. Any aspect of Perl you like. Long, short, funny, serious, advanced, basic: it doesn&#8217;t matter. It doesn&#8217;t have to be in English, either, if that&#8217;s not your native language.</em>&#8221; Why not try? Help yourself and help perl at the same time.</p>
<p>I&#8217;ll try to capture the half-baked ideas for perl blog posts as they cross my mind, then build on them as time and mood allow. Hopefully about one a week will mature into an actual blog post.</p>
<p>Meanwhile&#8230;</p>
<p>I remembered that almost exactly a year ago schwern <a href="http://use.perl.org/~schwern/journal/36263">blogged</a> that he was &#8220;<em>horrified at the junk which shows up when you search for perl blog on Google</em>&#8220;. It seems the situation hasn&#8217;t improved much since. The <a href="http://planet.perl.org">planet.perl.org</a> site is top, but the rest are a bit of a mishmash.</p>
<p>The problem is partly that &#8220;<a href="http://www.google.com/search?q=perl+blog">perl blog</a>&#8221; isn&#8217;t a great search term. Google naturally gives preference to words that appear in urls and titles (all else being equal), but blogs rarely explicitly call themselves blogs on their pages or urls. I suspect many on the first page of results are there because &#8216;blog&#8217; appears in the url.  (To help out I&#8217;ve included &#8220;perl blog&#8221; in the title of this post :)</p>
<p>Searching for &#8220;<a href="http://www.google.com/search?q=perl+blogs">perl blogs</a>&#8221; (plural) works better because it finds pages talking <em>about</em> perl blogs, which is useful when searching <em>for</em> perl blogs.</p>
<p>One entry in the &#8220;perl blogs&#8221; results was the Perl Foundation&#8217;s <a href="http://www.perlfoundation.org/perl5/index.cgi?blogs">wiki page listing perl blogs</a>. That was new to me. This blog wasn&#8217;t on it so I&#8217;ve added it. Got a perl blog, or know someone who has, that&#8217;s not listed on that page? Go and add it, now! It&#8217;ll only take a moment.</p>
<p>Along similar lines, I&#8217;ve added the phrases &#8220;perl blog&#8221; and &#8220;perl programming&#8221; to the sidebar of my blog pages. The first is to help people searching for &#8220;perl blog&#8221;. The second is mostly for <a href="http://blog.timbunce.org/2008/04/12/tiobe-or-not-tiobe-lies-damned-lies-and-statistics/">my own amusement</a>.</p>
<br />Posted in perl Tagged: blog, perl blogs, perl programming <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/268/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/268/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/268/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=268&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/05/10/thanks-iron-man-for-the-good-excuse-to-perl-blog/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Examples of Modern Perl</title>
		<link>http://blog.timbunce.org/2009/04/27/examples-of-modern-perl/</link>
		<comments>http://blog.timbunce.org/2009/04/27/examples-of-modern-perl/#comments</comments>
		<pubDate>Mon, 27 Apr 2009 11:01:26 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[modern perl]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=261</guid>
		<description><![CDATA[In the spirit of re-tweeting, this is a short post to highlight some great examples of &#8220;modern perl&#8221;. (I&#8217;m using the term modern perl very loosely, not referring specifically to any one book, website, or module or organization.)
Firstly I&#8217;d like to highlight a couple of recent posts by Jonathan Rockway:
* Unshortening URLs with Modern Perl. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=261&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In the spirit of re-tweeting, this is a short post to highlight some great examples of &#8220;modern perl&#8221;. (I&#8217;m using the term modern perl very loosely, not referring specifically to any <a href="http://translate.google.com/translate?u=http%3A%2F%2Fwww.amazon.co.jp%2Fdp%2F4798119172&amp;sl=ja&amp;tl=en&amp;hl=en&amp;ie=UTF-8">one</a> <a href="http://www.amazon.com/Modern-Perl-Programming-Michael-Saltzman/dp/0130089656">book</a>, <a href="http://www.modernperlbooks.com">website</a>, or <a href="http://search.cpan.org/perldoc?Modern::Perl">module</a> or <a href="http://www.enlightenedperl.org/">organization</a>.)</p>
<p>Firstly I&#8217;d like to highlight a couple of recent posts by Jonathan Rockway:</p>
<p>* <a href="http://blog.jrock.us/articles/Unshortening%20URLs%20with%20Modern%20Perl.pod">Unshortening URLs with Modern Perl</a>. An interesting example application built with modern perl modules like <a href="http://search.cpan.org/perldoc?MooseX::Declare">MooseX::Declare</a>, <a href="http://search.cpan.org/perldoc?MooseX::Getopt">MooseX::Getopt</a>, <a href="http://search.cpan.org/perldoc?HTTP::Engine">HTTP::Engine</a>, <a href="http://search.cpan.org/perldoc?AnyEvent::HTTP">AnyEvent::HTTP</a>, <a href="http://search.cpan.org/perldoc?TryCatch">TryCatch</a>, and <a href="http://www.iinteractive.com/kiokudb/">KiokuDB</a>.</p>
<p>* <a href="http://blog.jrock.us/articles/Multimethods.pod">Multimethods</a>. Another great example from Jonathan highlighting the combined power of <a href="http://search.cpan.org/perldoc?MooseX::Types">MooseX::Types</a>, <a href="http://search.cpan.org/perldoc?MooseX::Declare">MooseX::Declare</a>, and <a href="http://search.cpan.org/perldoc?MooseX::MultiMethods">MooseX:: MultiMethods</a>.</p>
<p>Then, from his work at the BBC, Curtis &#8220;<a href="http://use.perl.org/~Ovid/journal/">Ovid</a>&#8221; Poe has given us a great series of thoughtful posts on the benefits of replacing multiple inheritance with roles in a complex production code-base. The slides of his <a href="http://www.slideshare.net/Ovid/refactoring-with-roles-1298185">Refactoring With Roles</a> talk is a good place to start. Then dive in to the blog posts back <a href="http://use.perl.org/~Ovid/journal/38662">here</a> and work your way forward.</p>
<p>I &hearts; modern perl!</p>
<br />Posted in perl Tagged: modern perl, perl <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/261/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/261/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/261/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=261&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/04/27/examples-of-modern-perl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Generate Treemaps for HTML from Perl, please.</title>
		<link>http://blog.timbunce.org/2009/04/04/generate-treemaps-for-html-from-perl-please/</link>
		<comments>http://blog.timbunce.org/2009/04/04/generate-treemaps-for-html-from-perl-please/#comments</comments>
		<pubDate>Sat, 04 Apr 2009 11:55:35 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=258</guid>
		<description><![CDATA[Seeing this video of treemap for perlcritic memory usage reminded me of something&#8230;
I&#8217;d really like to be able to use treemaps in NYTProf reports to visualize the time spent in different parts, and depths, of the package namespace hierarchy. Currently that information is reported in a series of tables.
A much better interface could be provided [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=258&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Seeing <a href="http://www.youtube.com/watch?v=etYau_Xf9AM">this video</a> of treemap for perlcritic memory usage reminded me of something&#8230;</p>
<p>I&#8217;d <em>really</em> like to be able to use <a href="http://en.wikipedia.org/wiki/Treemap">treemaps</a> in <a href="http://blog.timbunce.org/tag/nytprof/">NYTProf</a> reports to visualize the time spent in different parts, and depths, of the package namespace hierarchy. Currently that information is <a href="http://blog.timbunce.org/2009/02/15/nytprof-208-better-faster-more-cuddly/">reported in a series of tables</a>.</p>
<p>A much better interface could be provided by treemaps. Ideally allowing the user to drill-down into deeper levels of the package namespace hierarchy. (It needn&#8217;t be <a href="http://www.youtube.com/watch?v=lQ5kiMwVtUY">this flashy</a>, just 2D would be fine :-)</p>
<p>In case you&#8217;re not familiar with them, treemaps are a great way to visualise hierarchical data. Here&#8217;s an example treemap of the disk space used by the files in a directory tree (from <a href="http://www.flickr.com/photos/schoschie/100056488/">schoschie</a>) <img src="http://timbunce.files.wordpress.com/2009/04/82244d56-fa2c-4044-ae46-ee53b63861be.jpg?w=500&#038;h=398" alt="82244D56-FA2C-4044-AE46-EE53B63861BE.jpg" border="0" width="500" height="398" /></p>
<p>Perl already has a <a href="http://search.cpan.org/dist/Treemap/">Treemap</a> module, which can generate treemap images via the <a href="http://search.cpan.org/perldoc?Imager">Imager</a> module. Treemap is designed to support more output formats by sub-classing.</p>
<p>I guess it wouldn&#8217;t be hard to write a sub-class to generate HTML client-side <a href="http://www.w3.org/TR/REC-html40/struct/objects.html#h-13.6">image map</a> data along with the image, so clicks on the image could be used to drill-down into treemaps that have more detail of the specific area that was clicked on.</p>
<p>More interesting, and more flexible, would be a sub-class to generate the treemap as a Scalable Vector Graphics diagram using the <a href="http://search.cpan.org/dist/SVG/">SVG</a> module (and <a href="http://search.cpan.org/search?query=svg&amp;mode=dist">others</a>).</p>
<p>I&#8217;m not going to be able to work on either of those ideas anytime soon.</p>
<p>Any volunteers?</p>
<br />Posted in perl Tagged: nytprof, perl, visualization <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/258/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/258/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/258/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=258&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/04/04/generate-treemaps-for-html-from-perl-please/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/04/82244d56-fa2c-4044-ae46-ee53b63861be.jpg" medium="image">
			<media:title type="html">82244D56-FA2C-4044-AE46-EE53B63861BE.jpg</media:title>
		</media:content>
	</item>
		<item>
		<title>Perl DynaLoader hack using .bs files</title>
		<link>http://blog.timbunce.org/2009/04/01/perl-dynaloader-hack-using-bs-files/</link>
		<comments>http://blog.timbunce.org/2009/04/01/perl-dynaloader-hack-using-bs-files/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 12:18:05 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=249</guid>
		<description><![CDATA[I needed to install a perl extension from a third-party. It&#8217;s an interface to a shared library, a .so file, that they also supply.
Normally I&#8217;d add the directory containing the shared library to the LD_LIBRARY_PATH environment variable. Then when the extension is loaded the system dynamic loader can find it.
For various reasons I didn&#8217;t want [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=249&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I needed to install a perl extension from a third-party. It&#8217;s an interface to a shared library, a .so file, that they also supply.</p>
<p>Normally I&#8217;d add the directory containing the shared library to the LD_LIBRARY_PATH environment variable. Then when the extension is loaded the system dynamic loader can find it.</p>
<p>For various reasons I didn&#8217;t want to do that in this case.</p>
<p>An alternative approach is to pre-load the shared library with a flag to make it&#8217;s symbols globally available for later linking. (The flag is called <code>RTLD_GLOBAL</code> on Linux, Solaris and other systems that use <code>dlopen()</code>. This hack may not work on other systems.)</p>
<p>But how to pre-load the shared library, only when needed, and without changing any existing perl code? This is where the pesky little .bs files that get installed with perl extensions come in handy.</p>
<p>They&#8217;re known as &#8216;bootstrap&#8217; files. If the .bs file for an extension not empty then DynaLoader (and XSLoader) will execute the contents just before loading the shared object for the extension.</p>
<p>So I put code like this into the .bs file for the extension:</p>
<pre>    use DynaLoader;
    DynaLoader::dl_load_file("$ENV{...}/...so", 1)
	    or die DynaLoader::dl_error();
</pre>
<p>Not a recommended approach, but neat and handy for me in this case.</p>
<br />Posted in perl  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=249&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/04/01/perl-dynaloader-hack-using-bs-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>NYTProf 2.09 &#8211; now handles modules using AutoLoader, like POSIX and Storable</title>
		<link>http://blog.timbunce.org/2009/03/30/nytprof-209-now-handles-modules-using-autoloader-like-posix-and-storable/</link>
		<comments>http://blog.timbunce.org/2009/03/30/nytprof-209-now-handles-modules-using-autoloader-like-posix-and-storable/#comments</comments>
		<pubDate>Mon, 30 Mar 2009 08:36:48 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=247</guid>
		<description><![CDATA[I&#8217;ve uploaded Devel::NYTProf 2.09 to CPAN.
If you&#8217;re using VMS the big news is that Peter (Stig) Edwards has contributed patches that enable NYTProf to work on VMS. Yeah! Thanks Peter.
For the rest of us there&#8217;s only one significant new feature in this release: NYTProf now includes a heuristic (that&#8217;s geek for &#8220;it&#8217;ll be wrong sometimes&#8221;) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=247&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded Devel::NYTProf 2.09 to CPAN.</p>
<p>If you&#8217;re using VMS the big news is that Peter (Stig) Edwards has contributed patches that enable NYTProf to work on VMS. Yeah! Thanks Peter.</p>
<p>For the rest of us there&#8217;s only one significant new feature in this release: NYTProf now includes a heuristic (that&#8217;s geek for &#8220;it&#8217;ll be wrong sometimes&#8221;) to handle modules using <a href="http://search.cpan.org/dist/AutoLoader/">AutoLoader</a>. The most common of which are Storable and POSIX. You may have encountered a warning like this when running nytprofhtml:</p>
<p>  <code>Unable to open '/../../lib/Storable.pm' for reading: No such file or directory</code></p>
<p>It&#8217;s a symptom of a deeper problem caused by <a href="http://search.cpan.org/perldoc?AutoSplit">AutoSplit</a>, the companion to AutoLoader. The details of the cause, effect, and fix aren&#8217;t worth going into now. If you&#8217;re interested you can read my <a href="http://groups.google.com/group/develnytprof-dev/tree/browse_frm/thread/2de2aecf1d5b153d/db48188f787b85d4?rnum=1&amp;q=Storable.pm&amp;_done=%2Fgroup%2Fdevelnytprof-dev%2Fbrowse_frm%2Fthread%2F2de2aecf1d5b153d%2F0f7ecccaca93b23d%3Flnk%3Dgst%26q%3DStorable.pm%26#doc_0f7ecccaca93b23d">summary</a> to the mailing list.</p>
<p>The upshot is that NYTProf now reports times for autoloaded subs as if the sub was part of the parent module. Just what you want. Time spent in the AUTOLOAD&#8217;er sub is also reported, naturally.</p>
<p>There is a small chance that the heuristic will pick the wrong &#8216;parent&#8217; module file for the autoloaded subroutine file. That can happen if there are other modules that use the same name for the last portion of the package name (e.g., Bar::Foo and Baz::Foo). If it ever happens to you, please let me know. Ideally with a small test case.</p>
<p>The list of changes can be found <a href="http://search.cpan.org/~timb/Devel-NYTProf-2.09/Changes#Changes_in_Devel::NYTProf_2.09_(svn_r733)_29th_March_2009">here</a> (or <a href="http://code.google.com/p/perl-devel-nytprof/source/list">here</a> if you&#8217;re a detail fanatic).</p>
<p>One other particularly notable item is that the <code>savesrc</code> option wasn&#8217;t working reliably. Thanks to Andy Grundman providing a good test case, that&#8217;s now been fixed.</p>
<p>Enjoy!</p>
<br />Posted in perl Tagged: nytprof, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/247/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/247/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/247/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=247&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/03/30/nytprof-209-now-handles-modules-using-autoloader-like-posix-and-storable/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>NYTProf screencast from the 2008 London Perl Workshop</title>
		<link>http://blog.timbunce.org/2009/02/25/nytprof-screencast-from-the-2008-london-perl-workshop/</link>
		<comments>http://blog.timbunce.org/2009/02/25/nytprof-screencast-from-the-2008-london-perl-workshop/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 03:09:21 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=234</guid>
		<description><![CDATA[I&#8217;ve uploaded the screencast of my NYTProf talk at the London Perl Workshop in November 2008.
It&#8217;s based on a not-quite-2.08 version and includes some coverage of an early draft of the &#8216;timings per rolled-up package name&#8217; feature I discussed previously.
It also shows how and why anonymous subroutines, defined at the same line of different executions [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=234&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve uploaded the <a href="http://blip.tv/file/1812013">screencast of my NYTProf talk</a> at the <a href="http://conferences.yapceurope.org/lpw2008/talk/1673">London Perl Workshop</a> in November 2008.</p>
<p>It&#8217;s based on a not-quite-2.08 version and includes some coverage of an early draft of the &#8216;timings per rolled-up package name&#8217; feature I <a href="http://blog.timbunce.org/2009/02/15/nytprof-208-better-faster-more-cuddly/">discussed previously</a>.</p>
<p>It also shows how and why anonymous subroutines, defined at the same line of different executions of the same string eval, get &#8216;merged&#8217;.</p>
<p>The demos use perlcritic and Moose code. It also includes a nice demonstration showing NYTProf highlighting a performance problem with File::Spec::Unix when called using Path::Class::Dir objects.</p>
<p>It&#8217;s 36 minutes long, including a good Q&amp;A session at the end (wherein a market rate for performance improvements is established). Enjoy.</p>
<br />Posted in perl Tagged: nytprof, performance, perl <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/234/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/234/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/234/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=234&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/02/25/nytprof-screencast-from-the-2008-london-perl-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>NYTProf 2.08 &#8211; better, faster, more cuddly</title>
		<link>http://blog.timbunce.org/2009/02/15/nytprof-208-better-faster-more-cuddly/</link>
		<comments>http://blog.timbunce.org/2009/02/15/nytprof-208-better-faster-more-cuddly/#comments</comments>
		<pubDate>Sun, 15 Feb 2009 22:06:45 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=227</guid>
		<description><![CDATA[I&#8217;ve just released NYTProf 2.08 to CPAN, some three and a half months after 2.07.
If you&#8217;ve been profiling large applications then the first difference you&#8217;ll notice is that the new version generates reports much faster.
The next thing you may notice is that statement timings are now nicely formatted with units. Gisle Aas contributed the formatting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=227&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just released NYTProf 2.08 to CPAN, some three and a half months after 2.07.</p>
<p>If you&#8217;ve been profiling large applications then the first difference you&#8217;ll notice is that the new version generates reports <em>much</em> faster.</p>
<p><img src="http://timbunce.files.wordpress.com/2009/02/nytprof-208-timings1.png?w=326&#038;h=201" alt="NYTProf 2.08 timings.png" border="0" width="326" height="201" align="left" />The next thing you may notice is that statement timings are now nicely formatted with units. Gisle Aas contributed the formatting code for 2.07 but I had to do some refactoring to get it working for the statement timings.</p>
<p>Another nice refinement is that hovering over a time will show a tool-tip with the time expressed as a percentage of the overall runtime.</p>
<p>Almost all <em>the tables are now sortable</em>. I used <a href="http://jquery.com/">jQuery</a> and the <a href="http://tablesorter.com">tablesorter</a> plugin for that. I&#8217;ve not added any fancy buttons, just click on a table heading to sort by that column. You&#8217;ll see a little black arrow to show the column is sorted. (You can hold the shift key down to add second and third columns to the sort order.)</p>
<p>A profiler isn&#8217;t much use if it&#8217;s not accurate. NYTProf now has tests for correct handling of times for string evals within string evals. In fact the handling of string evals got a big overhaul for this version as part of ongoing improvements in the underlying data model. I&#8217;m working towards being able to show annotated performance reports for the <em>contents of string evals</em>. It&#8217;s not there yet, but definitely getting closer.</p>
<p>A related feature is the new <code>savesrc=1</code> option. When enabled, with a recent version of perl, the source code for each source file is written into the profile data file. That makes the profile self-contained and, significantly, means that accurate reports can be generated even after the original source files have been modified.</p>
<p>Another new option is <code>optimize=0</code>. You can use it to disable the <a href="http://www.google.com/search?q=perl+optimizer">perl optimizer</a>. That can be worth doing if the statement timings, or counts, for some chunk of code seem odd and you suspect that the perl optimizer has rewritten it.</p>
<p>The final new feature noted in the NYTProf 2.08 Changes file is that it&#8217;s now possible to generate multiple profile data files from a single application. Since v2.0 you could call <code>DB::disable_profile()</code> and <code>DB::enable_profile()</code> to control profiling at runtime. Now you can pass an optional filename to <code>enable_profile</code> to make it close the previous profile and open a new one. I imagine this would be most useful in long running applications where you&#8217;d leave profiling disabled (using the <code>start=none</code> option) and then call <code>enable_profile</code> and <code>disable_profile</code> around some specific code in specific situations &#8211; like certain requests to a mod_perl app.</p>
<p>There&#8217;s one more new feature that I&#8217;ve just realised I&#8217;d forgotten to add to the Changes file before the release: Timings per rolled-up package name. What&#8217;s that? Well, it&#8217;s probably easiest to show you&#8230;</p>
<p>These images are taken from a profile of <a href="http://search.cpan.org/perldoc?perlcritic">perlcritic</a>. Each shows the time spent exclusively in subroutines belonging to a certain package <em>and any packages below it</em>. Hovering over a time gives the percentage, so I can see that the 57.3s spent in the 36 PPI packages accounted for 42% of the runtime.</p>
<p><img src="http://timbunce.files.wordpress.com/2009/02/nytprof-208-pkg1.png?w=517&#038;h=321" alt="NYTProf 2.08 pkg1.png" border="0" width="517" height="321" /></p>
<p>This gives you a quick overview for large (wide) codebases that would be hard to get in any other way.</p>
<p>Tables are generated for upto five levels of package name hierarchy, so you can drill-down to finer levels of detail.</p>
<p><img src="http://timbunce.files.wordpress.com/2009/02/nytprof-208-pkg2.png?w=530&#038;h=322" alt="NYTProf 2.08 pkg2.png" border="0" width="530" height="322" /></p>
<p>&nbsp;</p>
<p><img src="http://timbunce.files.wordpress.com/2009/02/nytprof-208-pkg3.png?w=650&#038;h=322" alt="NYTProf 2.08 pkg3.png" border="0" width="650" height="322" /></p>
<p>I can visualize a much better UI for this data than the series of tables nytprofhtml currently produces, but my limited free time and jQuery skills prevent me doing more. Patches welcome, naturally.</p>
<p>Enjoy!</p>
<p>p.s. I&#8217;ve a screencast from my NYTProf talk at the London Perl Workshop in November I hope to (finally) upload soon. It includes a demo of the package roll-up timing tables.</p>
<br />Posted in perl Tagged: nytprof, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=227&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/02/15/nytprof-208-better-faster-more-cuddly/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/02/nytprof-208-timings1.png" medium="image">
			<media:title type="html">NYTProf 2.08 timings.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/02/nytprof-208-pkg1.png" medium="image">
			<media:title type="html">NYTProf 2.08 pkg1.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/02/nytprof-208-pkg2.png" medium="image">
			<media:title type="html">NYTProf 2.08 pkg2.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2009/02/nytprof-208-pkg3.png" medium="image">
			<media:title type="html">NYTProf 2.08 pkg3.png</media:title>
		</media:content>
	</item>
		<item>
		<title>UltraDNS &#8211; A Perl Client API for NeuStar UltraDNS</title>
		<link>http://blog.timbunce.org/2009/01/28/ultradns-a-perl-client-api-for-neustar-ultradns/</link>
		<comments>http://blog.timbunce.org/2009/01/28/ultradns-a-perl-client-api-for-neustar-ultradns/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 22:45:43 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[tigerlead]]></category>
		<category><![CDATA[ultradns]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=217</guid>
		<description><![CDATA[My first Open Source spin-off from TigerLead.com: UltraDNS a Perl client API for UltraDNS.
Posted in perl Tagged: tigerlead, ultradns      <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=217&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>My first Open Source spin-off from <a href="http://tigerlead.com">TigerLead.com</a>: <a href="http://search.cpan.org/perldoc?UltraDNS">UltraDNS</a> a Perl client API for UltraDNS.</p>
<br />Posted in perl Tagged: tigerlead, ultradns <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/217/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=217&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/01/28/ultradns-a-perl-client-api-for-neustar-ultradns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>Can you reproduce this NYTProf failure?</title>
		<link>http://blog.timbunce.org/2009/01/28/can-you-reproduce-this-nytprof-failure/</link>
		<comments>http://blog.timbunce.org/2009/01/28/can-you-reproduce-this-nytprof-failure/#comments</comments>
		<pubDate>Wed, 28 Jan 2009 22:24:12 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=215</guid>
		<description><![CDATA[I&#8217;ve a new release of NYTProf ready to upload but I&#8217;m stuck.
The CPAN Testers service is reporting a failure on a number of systems but I can&#8217;t reproduce it locally or work out the cause.
Can you reproduce the failure with Devel::NYTProf 2.07_94? If so, could you give me remote access via ssh? (Or spare some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=215&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve a new release of NYTProf ready to upload but I&#8217;m stuck.</p>
<p>The CPAN Testers service is reporting a <a href="http://bbbike.radzeit.de/~slaven/cpantestersmatrix.cgi?dist=Devel-NYTProf%202.07_94">failure on a number of systems</a> but I can&#8217;t reproduce it locally or work out the cause.</p>
<p>Can you reproduce the failure with <a href="http://search.cpan.org/~timb/Devel-NYTProf-2.07_94/">Devel::NYTProf 2.07_94</a>? If so, could you give me remote access via ssh? (Or spare some time to investigate yourself &#8211; I&#8217;ll happily clue you in if you can reproduce the problem.)</p>
<p><em>Update</em>: No one could reproduce it. It seems that the failures was not what it appeared to be. A clue was that only one tester was affected. Devel-NYTProf-2.07_94.tar.gz unpacked itself into a directory called Devel-NYTProf-2.07. It seems that when using  CPANPLUS if the user had already got an old Devel-NYTProf-2.07 directory its contents got merged and tests would fail. I&#8217;m not convinced that&#8217;s the whole story, but Devel-NYTProf-2.07_95.tar.gz unpacked into a Devel-NYTProf-2.07_95 directory and didn&#8217;t run into the problem.</p>
<p><em>Update</em>: More usefully, Andreas made <a href="http://www.nntp.perl.org/group/perl.qa/2009/01/msg11895.html">my wish</a> come true by <a href="http://www.nntp.perl.org/group/perl.qa/2009/01/msg11907.html">pointing out</a> the &#8211;solve parameter to the <a href="http://search.cpan.org/perldoc?ctgetreports">ctgetreports</a> utility in his <a href="http://search.cpan.org/dist/CPAN-Testers-ParseReport/">CPAN::Testers::ParseReports</a> distribution. It  &#8220;<em>tries to identify the best contenders for a blame using Statistics::Regression. [...] The function prints the [...]  top 3 candidates according to R^2 with their regression analysis.</em>&#8221; Cool.</p>
<br />Posted in perl Tagged: nytprof <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/215/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/215/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/215/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=215&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2009/01/28/can-you-reproduce-this-nytprof-failure/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
		<item>
		<title>NYTProf 2.07 &#8211; Even better, and now for Windows too</title>
		<link>http://blog.timbunce.org/2008/11/01/nytprof-207-even-better-and-now-for-windows-too/</link>
		<comments>http://blog.timbunce.org/2008/11/01/nytprof-207-even-better-and-now-for-windows-too/#comments</comments>
		<pubDate>Sat, 01 Nov 2008 08:34:39 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=195</guid>
		<description><![CDATA[NYTProf development rolls on, with 2.07 being another significant release.

After the fold is a summary of highlights from the many improvements, with images and links for you reading pleasure.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=195&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>NYTProf development rolls on, with 2.07 being another significant release.</p>
<p>Here&#8217;s a summary of highlights from the <a href="http://search.cpan.org/~timb/Devel-NYTProf/Changes">many improvements</a>.</p>
<h2>Windows, at last</h2>
<p>Windows wizard <a href="http://search.cpan.org/~jdb/">Jan Dubois</a> has contributed patches that enable NYTProf to run on Windows. Many thanks Jan!</p>
<h2>Corrected Subroutine Total Time</h2>
<p>A significant error in time reported as spent in a subroutine has been fixed. It was showing the sum of the inclusive and exclusive time instead of just the inclusive time.</p>
<h2>String Evals</h2>
<p>One of NYTProf&#8217;s innovative features is tracking of subroutine calls <em>by calling location</em>. In earlier versions you couldn&#8217;t see calls made from within string evals. Now you can. Even for evals within evals:</p>
<div style="text-align:center;"><img src="http://timbunce.files.wordpress.com/2008/11/nytprof-string-eval.png?w=777&#038;h=389" alt="NYTProf string eval.png" border="0" width="777" height="389" /></div>
<p>That&#8217;s a big step forward for profiling code that makes heavy use of evals.</p>
<p>(The use of the &micro; micro symbol is also new &#8211; part of some helpful interface polishing contributed by <a href="http://search.cpan.org/~gaas/">Gisle Aas</a>. They&#8217;re not used on the statement timings yet, but will be at some point.)</p>
<h2>Recursion</h2>
<p>Previously the &#8216;inclusive time&#8217; reported for a subroutine wasn&#8217;t useful for subroutines called recursively. The overall inclusive time included the inclusive time of nested calls, typically inflating it beyond usefulness.</p>
<p>Now the inclusive time only measures the inclusive time of the <em>outermost</em> calls. NYTProf now also tracks and reports the <em>maximum call depth</em> for each calling location.</p>
<h2>Disabling the Statement Profiler</h2>
<p>NYTProf started life as a statement profiler. I added a subroutine profiler later and was delighted with how well that worked out. The subroutine profiler is novel in a few ways and also extremely robust and efficient. Part of the efficiency comes from not streaming data to disk while the program is running. It accumulates the counts and timings in memory.</p>
<p>When profiling large and/or performance sensitive applications the costs of NYTProf&#8217;s statement profiler, in performance impact and disk space, can be prohibitive. So now I&#8217;ve added an option to disable the statement profiler. Setting the <code>stmts=0</code> option turns NYTProf into a very lightweight subroutine profiler.</p>
<h2>Caller Information for XSubs</h2>
<p>NYTProf reports time spent in subroutines broken down by calling location. It&#8217;s one of its key features. The caller details are embedded as comment annotation into the report for each perl source code file.</p>
<p>That has worked very well for perl subs, but there&#8217;s no natural home for XS subroutines because there was no source code file available to annotate.</p>
<p>There&#8217;s a partial solution included in NYTProf 2.07: XS subs that are in the same package as profiled perl subs, get annotated subroutine &#8217;stubs&#8217; appended to the report for the corresponding perl source file.</p>
<p>It works quite well, in particular the common UNIVERSAL methods get annotated:</p>
<div style="text-align:center;"><img src="http://timbunce.files.wordpress.com/2008/11/nytprof-xsub-callers.png?w=756&#038;h=114" alt="NYTProf xsub callers.png" border="0" width="756" height="114" /></div>
<p>Also, now these subs have a place in the reports, any references to them are hyper links, naturally.</p>
<p>Sadly it doesn&#8217;t work so well for packages that don&#8217;t contain any perl subs, like <code>DBI::st</code>. I plan to add per-package report pages for them in a future release.</p>
<h2>Clock Docs</h2>
<p>I&#8217;ve greatly expanded the <a href="http://search.cpan.org/~timb/Devel-NYTProf/lib/Devel/NYTProf.pm#CLOCKS">description of the various clocks</a> available for profiling: POSIX real-time clocks, <code>gettimeofday()</code>, and <code>Time::HiRes</code>.</p>
<p>I&#8217;ve also added a <a href="http://search.cpan.org/~timb/Devel-NYTProf/lib/Devel/NYTProf.pm#SMP_Systems">caveats</a> section that discusses issues with SMP systems, processor affinity, and virtual machines.</p>
<h2>Feedback Wanted</h2>
<p>How has NYTProf helped you optimize your applications? Let me know.</p>
<p>Perhaps as blog posts of your own, linking back here, or comments here, or <a href="http://cpanratings.perl.org/d/Devel-NYTProf">CPAN ratings</a>, or email to <a href="http://groups.google.com/group/develnytprof-dev/">the mailing list</a> or just to me. I&#8217;d love to hear from you.</p>
<p>Thanks!</p>
<br />Posted in perl Tagged: nytprof, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/195/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/195/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/195/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=195&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2008/11/01/nytprof-207-even-better-and-now-for-windows-too/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2008/11/nytprof-string-eval.png" medium="image">
			<media:title type="html">NYTProf string eval.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2008/11/nytprof-xsub-callers.png" medium="image">
			<media:title type="html">NYTProf xsub callers.png</media:title>
		</media:content>
	</item>
		<item>
		<title>NYTProf 2.05 &#8211; assorted fixes</title>
		<link>http://blog.timbunce.org/2008/10/08/nytprof-205-assorted-fixes/</link>
		<comments>http://blog.timbunce.org/2008/10/08/nytprof-205-assorted-fixes/#comments</comments>
		<pubDate>Wed, 08 Oct 2008 23:34:53 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=192</guid>
		<description><![CDATA[Hot on the heels of NYTProf 2.04, I&#8217;ve just released NYTProf 2.05. It has a few small but significant bug fixes. From the Changes file:

  Fixed alteration of $! during profiling, thanks to Slaven Rezic.
  Fixed clock_gettime() clock selection to fallback to CLOCK_REALTIME
    if CLOCK_MONOTONIC is not available, e.g, on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=192&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Hot on the heels of NYTProf 2.04, I&#8217;ve just released NYTProf 2.05. It has a few small but significant bug fixes. From the Changes file:</p>
<pre>
  Fixed alteration of $! during profiling, thanks to Slaven Rezic.
  Fixed clock_gettime() clock selection to fallback to CLOCK_REALTIME
    if CLOCK_MONOTONIC is not available, e.g, on linux 2.4.
  Fixed error when application ends after DB::disable_profile().
  Added some docs to Devel::NYTProf::Apache
  Added clock=N option to enable user to select the clock.
</pre>
<p>All the bugs were long-standing ones that happened to come to light and get fixes after 2.04 was released.</p>
<p>The first was the cause of a couple of <a href="http://rt.cpan.org/Ticket/Display.html?id=39396">odd</a> <a href="http://rt.cpan.org/Ticket/Display.html?id=39773">bugs</a> were applications would behave differently when profiled. The problem was that in certain situations the profiler would alter the value of $! between statements, so code that tested for $! would think something had gone wrong.</p>
<p>The second caused weird timing values on some platforms. The statement times would be zero and the subroutine times would be garbage. The problem was that some systems, such as Linux 2.4, define the CLOCK_MONOTONIC macro but don&#8217;t implement that clock in the kernel. NYTProf wasn&#8217;t testing that the clock worked. Now it does. If the clock_gettime() call fails with the selected clock it falls back to CLOCK_REALTIME (and if that fails NYTProf aborts).</p>
<p>As a bonus I&#8217;ve added the ability to select what clock you want to use by setting <code>clock=<em>N</em></code> in the NYTPROF environment variable, where N is the integer id of the clock you want to use (usually you can find the CLOCK_* macros in the /usr/include/time.h file). This only works if your system supports <a href="http://www.freebsd.org/cgi/man.cgi?query=clock_gettime">clock_gettime()</a>, which most modern unix-like systems do, with the notable exception of OS X.</p>
<p>Why would you want to use a different clock?</p>
<p>Well the default, CLOCK_MONOTONIC, is <a href="http://www.nabble.com/Micro-benchmark-for-various-time-syscalls...-to17594175.html#a17606351">relatively expensive</a> to call, and NYTProf calls it <em>twice per statement</em>. So it&#8217;s the dominant cost of the profiler.</p>
<p>Some systems, like Linux 2.6, offer other clocks, like CLOCK_MONOTONIC_FAST that returns the most recently <em>cached</em> value of the clock. That&#8217;s typically just 1/10th the cost of CLOCK_MONOTONIC, so your code runs much faster under the profiler.</p>
<p>Naturally there&#8217;s a trade-off: the accuracy of the timings drops significantly. Still <a href="http://blog.timbunce.org/2008/07/12/devel-dprof-broken-by-the-passage-of-time/">far better than Devel::DProf</a>, but far worse than normal. You&#8217;re dependent on how often the cached time value gets updated by your kernel. I saw a figure of &#8220;600 times per second&#8221; quoted for one system, but I can&#8217;t find the link now. My advice would be to steer clear of this feature unless you feel comfortable with the issues <a href="http://www.nabble.com/Micro-benchmark-for-various-time-syscalls...-to17594175.html#a17606351">like</a> <a href="http://sean.chittenden.org/news/2008/06/01/">these</a>.</p>
<p>Enjoy!</p>
<br />Posted in perl Tagged: nytprof, performance <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/192/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/192/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/192/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=192&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2008/10/08/nytprof-205-assorted-fixes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/1cf82705f5ab43c73273ab5d690866b3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">TimBunce</media:title>
		</media:content>
	</item>
	</channel>
</rss>