<?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; postgresql</title>
	<atom:link href="http://blog.timbunce.org/tag/postgresql/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.timbunce.org</link>
	<description>Listen. Reflect. Explore. Solve.</description>
	<lastBuildDate>Thu, 29 Jul 2010 00:00:18 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<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; postgresql</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..." />
	<atom:link rel='hub' href='http://blog.timbunce.org/?pushpress=hub'/>
		<item>
		<title>Looking for a new job? TigerLead is also Hiring in Ann Arbor MI</title>
		<link>http://blog.timbunce.org/2010/07/02/looking-for-a-new-job-tigerlead-is-also-hiring-in-ann-arbor-mi/</link>
		<comments>http://blog.timbunce.org/2010/07/02/looking-for-a-new-job-tigerlead-is-also-hiring-in-ann-arbor-mi/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 19:41:27 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=443</guid>
		<description><![CDATA[In addition to the job vacancy in West LA, the company I work for, TigerLead.com, has an opening for a &#8220;skilled developer&#8221; in Ann Arbor, Michigan: Our work involves manipulating and warehousing external data feeds and developing web interfaces to create home search tools for prospective buyers and lead management tools for real estate agents. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=443&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>In addition to the <a href="http://blog.timbunce.org/2010/07/02/looking-for-a-new-job-tigerlead-is-hiring-in-west-la/">job vacancy in West LA</a>, the company I work for, <a href="http://www.tigerlead.com/">TigerLead.com</a>, has an opening for a &#8220;skilled developer&#8221; in Ann Arbor, Michigan:</p>
<blockquote><p> Our work involves manipulating and warehousing external data feeds and developing web interfaces to create home search tools for prospective buyers and lead management tools for real estate agents. We&#8217;re looking for a skilled coder to join our small team of talented engineers in Ann Arbor. We hope to find an experienced programmer who is a good fit with our team, well-versed in multiple languages, able to learn quickly and work independently. We work in a Linux environment, and tools and languages we use include Perl, Ruby on Rails, PostgreSQL, and GIT. Perl experience is a significant plus, but your current comfort level with any of these specific tools is less important than overall technical aptitude and ability to learn quickly and fit in well with the current team.</p></blockquote>
<p>That&#8217;s a little thin on details partly because the work is varied. If you think you might be interested, take a look at the <a href="http://annarbor.craigslist.org/eng/1804836163.html">full job posting</a>.</p>
<p>TigerLead is a lovely company to work for and this is a great opportunity. Highly recommended.</p>
<br />Filed under: <a href='http://blog.timbunce.org/category/tech/software/'>software</a> Tagged: <a href='http://blog.timbunce.org/tag/jobs/'>jobs</a>, <a href='http://blog.timbunce.org/tag/perl/'>perl</a>, <a href='http://blog.timbunce.org/tag/postgresql/'>postgresql</a>, <a href='http://blog.timbunce.org/tag/ruby/'>ruby</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/443/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/443/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/443/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=443&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2010/07/02/looking-for-a-new-job-tigerlead-is-also-hiring-in-ann-arbor-mi/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>Looking for a new job? TigerLead is Hiring in West LA</title>
		<link>http://blog.timbunce.org/2010/07/02/looking-for-a-new-job-tigerlead-is-hiring-in-west-la/</link>
		<comments>http://blog.timbunce.org/2010/07/02/looking-for-a-new-job-tigerlead-is-hiring-in-west-la/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 17:37:22 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[jobs]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=439</guid>
		<description><![CDATA[The company I work for, TigerLead.com, has an opening for a &#8220;skilled coder / database wrangler&#8221;. We&#8217;re looking for a skilled coder / database wrangler to play a key role within our Operations and Engineering teams. The various responsibilities of the job include working with the large databases underlying our real estate search tools, setting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=439&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>The company I work for, <a href="http://www.tigerlead.com/">TigerLead.com</a>, has an opening for a &#8220;skilled coder / database wrangler&#8221;. </p>
<blockquote><p>We&#8217;re looking for a skilled coder / database wrangler to play a key role within our Operations and Engineering teams. The various responsibilities of the job include working with the large databases underlying our real estate search tools, setting up services for new clients, communicating with clients to evaluate bug reports, troubleshooting technical issues escalated by our client services team, and interfacing with the engineering team on systems maintenance and development. The scope of work that we do involves managing hundreds of external data feeds that feed into in-house databases totaling several million property listings. These listing databases power hundreds of real estate search sites used by more than a million home-buyer leads, who are tracked and cultivated by the thousands of Realtors using our management software. This position is critical to the robustness of these systems.</p></blockquote>
<p>If that sounds like interesting work to you then take a look at the <a href="http://losangeles.craigslist.org/wst/eng/1821042952.html">full job posting</a>.</p>
<p>TigerLead is a lovely company to work for and this is a great opportunity. Highly recommended.</p>
<br />Filed under: <a href='http://blog.timbunce.org/category/tech/software/'>software</a> Tagged: <a href='http://blog.timbunce.org/tag/jobs/'>jobs</a>, <a href='http://blog.timbunce.org/tag/perl/'>perl</a>, <a href='http://blog.timbunce.org/tag/postgresql/'>postgresql</a>, <a href='http://blog.timbunce.org/tag/ruby/'>ruby</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/439/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/439/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/439/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=439&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2010/07/02/looking-for-a-new-job-tigerlead-is-hiring-in-west-la/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 v4 &#8211; Now with string-eval x-ray vision!</title>
		<link>http://blog.timbunce.org/2010/06/09/nytprof-v4-now-with-string-eval-x-ray-vision/</link>
		<comments>http://blog.timbunce.org/2010/06/09/nytprof-v4-now-with-string-eval-x-ray-vision/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 19:26:17 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=393</guid>
		<description><![CDATA[I released Devel::NYTProf v3 on Christmas Eve 2009. Over the next couple of months a few more features were added. The v3 work had involved a complete rewrite of the subroutine profiler and heavy work on much else besides. At that point I felt I&#8217;d done enough with NYTProf for now and it was time [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=393&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I released Devel::NYTProf <a href="http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/">v3 on Christmas Eve</a> 2009. Over the next couple of months a <a href="http://blog.timbunce.org/2010/03/18/polishing-nytprof/">few more features</a> were added. The v3 work had involved a complete rewrite of the subroutine profiler and heavy work on much else besides. At that point I felt I&#8217;d done enough with NYTProf for now and it was time to focus on other more pressing projects.
</p>
<p>Over those months I&#8217;d also started working on <a href="http://blog.timbunce.org/2009/10/05/wishlist-of-plperl-enhancements-for-postgresql-8-5/">enhancements for PostgreSQL PL/Perl</a>. That project turned into something of an <em>epic adventure</em> with more than its fair share of highs and lows and twists and turns. The dust is only just settling now. I would have blogged about it but security issues arose that led the PostgreSQL team to consider removing the plperl language entirely. Fortunately I was able to help avoid that by removing Safe.pm entirely! At some point I hope to write a blog post worthy of the journey. Meanwhile, if you&#8217;re using PostgreSQL, you really do want to upgrade to the latest point-release.
</p>
<p>One of the my goals in enhancing PostgreSQL PL/Perl was improve the integration with NYTProf. I wanted to be able to profile PL/Perl code embedded in the database server. With PostgreSQL 8.4 I could get the profiler to run, with some <a href="http://github.com/timbunce/posgtresql-plperl-injector/blob/master/lib/PostgreSQL/PLPerl/Injector.pm">hackery</a>, but in the report the subroutines were all __ANON__ and you couldn&#8217;t see the source code, so there were no statement timings. <em>It was useless</em>.
</p>
<p>The key problem was that Devel::NYTProf couldn&#8217;t see into string evals properly. To fix that I <em>had</em> to go back spelunking deep in the NYTProf guts again; mostly in the data model and report generation code. With NYTProf v4, string evals are now treated as files, mostly, and a whole new level of insight is opened up!
</p>
<p>In the rest of this post I&#8217;ll be describing this and other new features.</p>
<p><span id="more-393"></span></p>
<h2>Seeing Into String Evals</h2>
<p>Let&#8217;s start by taking a look at a small example:</p>
<blockquote><p><code>perl -d:NYTProf -e 'eval("sub { $_ }")-&gt;() for 1,2,2'</code>
</p></blockquote>
<p>That executes three string evals, each of which defines an anonymous subroutine which is then executed. Two of the three evals have identical source code.</p>
<p>With NYTProf 3.11 the report for the &#8220;<code>-e</code> file&#8221; looked like this:</p>
<p><img src="http://timbunce.files.wordpress.com/2010/06/nytprof-eval-sub-example1-3111.png?w=765&#038;h=260" alt="NYTProf eval-sub example1 311.png" border="0" width="765" height="260" /></p>
<p>Two key things to note: Firstly, there&#8217;s no link to drill-down to see the actual source code executed by the eval. (In this example we can <em>see</em> the source, but that&#8217;s rare in practice.) Secondly, the three anonymous subroutines have been merged. You can&#8217;t see individual details like call counts, callers, or timings.</p>
<p>(In case you&#8217;re wondering, the main::BEGIN subroutine is defined as a side effect of loading NYTProf, and the main::RUNTIME subroutine is a dummy created by NYTProf to act as the &#8216;root caller&#8217;. You&#8217;ll see it appear as the caller of the anonymous subs in a later screenshot.)</p>
<p>With NYTProf 4.00 the same report looks like this:</p>
<p><img src="http://timbunce.files.wordpress.com/2010/06/screen-shot-2010-06-08-at-00-11-03.png?w=766&#038;h=291" alt="NYTProf eval-sub example1 400.png" border="0" width="766" height="291" /></p>
<p>Now you can see much more detail right there. The two evals with identical source code have been merged, as have the identical anonymous subroutines defined by them. The eval and anonymous sub with different source code have been kept separate. What you can&#8217;t easily see from the image is that the &#8220;<code>string eval</code>&#8221; texts in the grey annotation are links. This is where it&#8217;s gets more interesting&#8230;</p>
<p>Clicking on the &#8220;<code>2 string evals (merged)</code>&#8221; link takes us to a typical NYTProf report page showing the performance-annotated source code executed by the eval:</p>
<p><img src="http://timbunce.files.wordpress.com/2010/06/nytprof-eval-sub-example1-eval1.png?w=849&#038;h=359" alt="NYTProf eval-sub example1 eval.png" border="0" width="849" height="359" /></p>
<p>What you&#8217;re looking at here is source code <em>that never existed as a file</em>. (That second line containing a semicolon was added by perl as part of the implementation of <code>eval</code>.)</p>
<p>In the table at the top, you&#8217;ll see &#8220;Eval Invoked At&#8221; with a link that&#8217;ll take you to the eval statement that executed this source code. You&#8217;ll also see a &#8220;Sibling evals&#8221; row. That&#8217;s added in cases where an eval was executed multiple times and not all were merged into a single report. Finally, because this particular eval includes data merged from others, the report includes a clear banner alerting you to how many evals were merged to produce this report page.</p>
<p><em><strong>Update</strong>: You&#8217;ll need a recent version of perl (5.8.9+, 5.10.1+, or 5.12+) to see the eval source code.<br />
</em></p>
<p>So why does NYTProf go to all the effort of merging evals and anonymous subs? Here&#8217;s a real-world example using <a href="https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-perlcritic-demo/PPI-Node-pm-56-line.html#645">a profile of perlcritic</a>:</p>
<p><img src="http://timbunce.files.wordpress.com/2010/06/nytprof-eval-sub-perlcritic1.png?w=795&#038;h=154" alt="NYTProf eval-sub perlcritic1.png" border="0" width="795" height="154" /></p>
<p>Without merging, those 4196 evals would have produced 4196 report pages! Their sheer volume making them almost useless. Now it&#8217;s clear from the report that only a few distinct source code strings are used and <a href="https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-perlcritic-demo/(eval%20189)[-usr-local-perl512-dev-lib-site_perl-5-12-0-PPI-Node-pm-654]-516-line.html">the reports</a> for each are <em>far</em> more useful.</p>
<p>In that example perlcritic is compiling lots of tiny snippets of code. Many applications use string eval to compile large quantities of code. The <a href="http://search.cpan.org/perldoc?ORLite">ORLite module</a> is one example. It dynamically generates and compiles a large chunk of code with many subroutines that implement a customized interface for a specific <a href="http://www.sqlite.org/">SQLite</a> database file.</p>
<p>With NYTProf 3.11 you couldn&#8217;t <em>see</em> the hundreds of lines of source code, <em>or</em> the per-caller subroutine performance, <em>or</em> the individual statement performance. All you could see was a list of subs calls and the overall time spent in each:</p>
<p><img src="http://timbunce.files.wordpress.com/2010/06/nytprof-eval-sub-cpangraph-311.png?w=905&#038;h=249" alt="NYTProf eval-sub cpangraph 311.png" border="0" width="905" height="249" /> </p>
<p>That was better than nothing, but now, with NYTProf v4, <a href="https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-cpangraph-demo/(eval%20957)[-usr-local-perl512-dev-lib-site_perl-5-12-0-ORLite-pm-586]-1097-line.html">you can see everything</a>!</p>
<div style="background-color:#eeeeee;padding:10px;">
Aside&hellip;</p>
<h2>I see a SQLite in the Distance</h2>
<p>Getting all this working correctly, especially the data model manipulations required for merging evals and anonymous subroutines, was far more painful than I&#8217;d anticipated. I both blessed and cursed the test suite on numerous occasions!</p>
<p>I think it would be wise for NYTProf reporting and data model code to read the data from, and manipulate the data in, an SQLite database. That would yield simpler more maintainable code. It would also be enable nytprofhtml to be used for presenting performance data from other sources, including perl6.</p>
<p>If you&#8217;re interested in working on this, starting with a utility to load an nytprof.out file into a SQLite database, please <a href="http://groups.google.com/group/develnytprof-dev">contact the mailing list</a>.
</div>
<p></p>
<h2>String Eval Timings</h2>
<p>There&#8217;s a slight caveat worth noting about the timings shown for string evals <em>that define subroutines</em>.</p>
<p>Timings for string evals are taken from the statement profiler (the subroutine profiler doesn&#8217;t pay attention to evals). So the &#8220;time spent executing the eval&#8221; is the sum of the time spent executing <em>any statements within the eval</em>.</p>
<p>That&#8217;s fine for evals that don&#8217;t define subroutines. For those that do, the time for the eval includes not only the time spent executing the eval itself but also time spent executing statements in subroutines defined within the eval but called later from outside it.</p>
<p>Hence the careful wording you can see in the example from perlcritic shown previously:</p>
<blockquote><pre># spent  2.65s executing statements in 1369 string evals (merged)
# includes 1.83s spent executing 122015 calls to 1 sub defined therein.</pre>
</blockquote>
<p>I could have automatically subtracted the subroutine time from the eval time but I was wary about doing that (for some reason that currently escapes me). Maybe that&#8217;ll change in the near future. Further out, a future version of NYTProf might use the subroutine profiler logic to time evals. That&#8217;s a deeper change that would give a more natural view of the timings.</p>
<h2>Other Changes in v4</h2>
<ul>
<li>Subroutines that couldn&#8217;t be associated with a perl source file, such as xsubs in packages with no perl source, used to not appear in reports at all. So associated caller and timing information couldn&#8217;t be seen. <a href="https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-cpangraph-demo/usr-local-perl512-dev-bin-cpangraph-1-line.html#163">Now it can</a>.
</li>
<li>Similarly, subroutine calls that couldn&#8217;t be associated with a specific <em>line</em>, such as calls made by perl to END blocks, are now shown in reports. They appear as <a href="https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-cpangraph-demo/usr-local-perl512-dev-bin-cpangraph-1-line.html#0">as calls from line 0</a>.
</li>
<li>NYTProf v3 added renaming of <code>BEGIN</code> subs, so a BEGIN (or <code>use</code>) on line 3 would be called <code>BEGIN@3</code> and so kept distinct from others in the same package. NYTProf v4 takes that further by detecting the rare cases where the modified name isn&#8217;t unique and adding a sequence number to it, like <a href="https://www.me.com/ix/tim.bunce/Public/perl/nytprof/nytprof-cpangraph-demo/(eval%20957)[-usr-local-perl512-dev-lib-site_perl-5-12-0-ORLite-pm-586]-1097-line.html#3"><code>BEGIN@3.59</code></a>.
</li>
<li>NYTProf v2 added the savesrc option to enable storing a copy of the profiled perl source code into the profile data file itself. This makes report generation immune from later changes to the source files. NYTProf v4 now enables that option by default.
</li>
<li>The report generator used to only generate report lines up to the maximum number of source lines present. If there was no source code available, for whatever reason, you&#8217;d get an empty report for that file, even though there was useful information to report. Now the report generates enough lines to ensure all available profile information gets included. This is especially useful for old perl versions where source code is more likely to be unavailable. Also, the report generator now collapses groups of three or more blank lines.
</li>
<li>Nicholas Clark contributed changes to refine the timing of the beginning and end of profiling. Now END blocks defined at runtime are included in the profile and compilation-only checks (e.g., <code>perl -c</code>) can also be profiled.
</li>
<li>You may be aware that the <code>POSIX::_exit</code> function exits the process immediately, without flushing stdio buffers and without giving perl a chance to clean up. That means NYTProf didn&#8217;t get a chance to finish and the profile wasn&#8217;t usable. NYTProf v4 now intercepts calls to <code>POSIX::_exit</code> and cleans up properly.
</li>
<li>Finally, tired of waiting for nytprofhtml to produce a report from a long profile run? The new <code>--minimal</code> (-m) option makes nytprofhtml skip building reports for the rarely used &#8216;blocks&#8217; and &#8216;subs&#8217; levels of detail and skips generating the graphviz .dot files. That saves a lot of time.
</li>
</ul>
<p>Enjoy!</p>
<br />Filed under: <a href='http://blog.timbunce.org/category/tech/software/perl/'>perl</a> Tagged: <a href='http://blog.timbunce.org/tag/nytprof/'>nytprof</a>, <a href='http://blog.timbunce.org/tag/performance/'>performance</a>, <a href='http://blog.timbunce.org/tag/postgresql/'>postgresql</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/393/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/393/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/393/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=393&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2010/06/09/nytprof-v4-now-with-string-eval-x-ray-vision/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/2010/06/nytprof-eval-sub-example1-3111.png" medium="image">
			<media:title type="html">NYTProf eval-sub example1 311.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2010/06/screen-shot-2010-06-08-at-00-11-03.png" medium="image">
			<media:title type="html">NYTProf eval-sub example1 400.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2010/06/nytprof-eval-sub-example1-eval1.png" medium="image">
			<media:title type="html">NYTProf eval-sub example1 eval.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2010/06/nytprof-eval-sub-perlcritic1.png" medium="image">
			<media:title type="html">NYTProf eval-sub perlcritic1.png</media:title>
		</media:content>

		<media:content url="http://timbunce.files.wordpress.com/2010/06/nytprof-eval-sub-cpangraph-311.png" medium="image">
			<media:title type="html">NYTProf eval-sub cpangraph 311.png</media:title>
		</media:content>
	</item>
		<item>
		<title>Polishing NYTProf</title>
		<link>http://blog.timbunce.org/2010/03/18/polishing-nytprof/</link>
		<comments>http://blog.timbunce.org/2010/03/18/polishing-nytprof/#comments</comments>
		<pubDate>Thu, 18 Mar 2010 10:30:03 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[perl]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[postgresql]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=376</guid>
		<description><![CDATA[I released Devel::NYTProf 3.0 almost three months ago, on Christmas Eve. Since then a few point releases have accumulated some changes and features worth mentioning: Jan Dubois contributed portability fixes for Windows and 64bit configurations. NYTProf should now run well on most, if not all, Windows configurations with recent versions of perl. Markus Peter contributed [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=376&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I released <a href="http://search.cpan.org/dist/Devel-NYTProf">Devel::NYTProf</a> 3.0 almost three months ago, <a href="http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/">on Christmas Eve</a>.</p>
<p>Since then a few point releases have accumulated some changes and features worth mentioning:</p>
<p><span id="more-376"></span>
<ul>
<li> Jan Dubois contributed portability fixes for Windows and 64bit configurations. NYTProf should now run well on most, if not all, Windows configurations with recent versions of perl.
</li>
<li> Markus Peter contributed a sub-microsecond timer for Mac OS X. It yields the same 100ns resolution used on systems with POSIX realtime clocks.
</li>
<li> Nicholas Clark has contributed a huge amount of work recently, including many optimizations and a <em>major</em> refactoring of I/O.
</li>
<li> Nicholas&#8217;s <code>nytprofmerge</code> utility is now significantly faster as a result of those changes. He&#8217;s also fixed a bunch of edge cases. If you&#8217;re generating multiple profile data files and would like to merge them into a single report, <code>nytprofmerge</code> is now a very effective tool.
</li>
<li>I fixed the <code>usecputime=1</code> option as it was broken in several ways. It&#8217;s still of limited value and the docs now explain that more clearly.
</li>
<li>I&#8217;ve also added a section to the docs to explain how to make NYTProf faster. For those rare cases where the performance impact of profiling is a problem.
</li>
<li>Assorted crashing bugs and odd behaviors in edge cases (like <code>goto &amp;sub</code> out of an <code>AUTOLOAD</code> being called for a <code>DESTROY</code> in perl &lt;5.8.8) have been fixed. NYTProf now also behaves more sanely with multiplicity and threads (although it still can&#039;t actually profile multiple threads or interpreters).
</li>
<li>The <code>Devel::NYTProf::PgPLPerl</code> module has been removed and the code moved to a separate <a href="http://search.cpan.org/perldoc?PostgreSQL::PLPerl::NYTProf"><code>PostgreSQL::PLPerl::NYTProf</code></a> distribution.
</li>
<li>One little UI tweak worth noting is that sortable tables now show a little arrow in the heading of the sorted column. If you didn&#8217;t know that you could click most column headings to sort by that column, hopefully the arrow will act as a visual reminder.
</li>
</ul>
<p>The only thing I&#8217;m likely to work on soon is the handling is string evals. They&#8217;re mostly hidden in the reports now. I need to improve that to make <code>PostgreSQL::PLPerl::NYTProf</code> actually <em>useful</em>. So that&#8217;s pretty much bound to happen sometime between now and my speaking at <a href="http://www.pgcon.org/2010/">PGcon</a> in May.</p>
<p>Meanwhile, if you&#8217;re not using Devel::NYTProf 3.11, <a href="http://search.cpan.org/dist/Devel-NYTProf/">upgrade</a>!</p>
<br />Filed under: <a href='http://blog.timbunce.org/category/tech/software/perl/'>perl</a> Tagged: <a href='http://blog.timbunce.org/tag/nytprof/'>nytprof</a>, <a href='http://blog.timbunce.org/tag/performance/'>performance</a>, <a href='http://blog.timbunce.org/tag/perl/'>perl</a>, <a href='http://blog.timbunce.org/tag/postgresql/'>postgresql</a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/376/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/376/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/376/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=376&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2010/03/18/polishing-nytprof/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>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 [...]<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>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>Crouching Tiger</title>
		<link>http://blog.timbunce.org/2008/12/17/crouching-tiger/</link>
		<comments>http://blog.timbunce.org/2008/12/17/crouching-tiger/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 12:31:37 +0000</pubDate>
		<dc:creator>TimBunce</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[dashprofiler]]></category>
		<category><![CDATA[gofer]]></category>
		<category><![CDATA[nytprof]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[tigerlead]]></category>

		<guid isPermaLink="false">http://timbunce.wordpress.com/?p=213</guid>
		<description><![CDATA[After almost exactly two years working for Shopzilla I&#8217;ve moved on. I&#8217;ve enjoyed my time with Shopzilla, met some great people, and worked on some challenging problems. I&#8217;m especially grateful to them for giving me the opportunity to develop and release some very useful Open Source software: Gofer, DashProfiler, and especially NYTProf v2. When I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=213&subd=timbunce&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>After almost exactly two years working for Shopzilla I&#8217;ve moved on.</p>
<p>I&#8217;ve enjoyed my time with Shopzilla, met some great people, and worked on some challenging problems. I&#8217;m especially grateful to them for giving me the opportunity to develop and release some very useful Open Source software: <a href="http://search.cpan.org/perldoc?DBD::Gofer">Gofer</a>, <a href="http://search.cpan.org/perldoc?DashProfiler">DashProfiler</a>, and especially <a href="http://search.cpan.org/perldoc?Devel::NYTProf">NYTProf v2</a>.</p>
<p>When I started with ValueClick back in 1999 it was a small company. Over the years I was with them it grew rapidly, both from within and via mergers. When I left in 2006 it had become a very large company. For me Shopzilla was always a very large company.</p>
<p>I <em>really</em> like to make a significant positive impact where I work. I believe I did that at ValueClick and Shopzilla, but it&#8217;s always easier at a smaller company. There&#8217;s far less inertia to overcome.</p>
<p>So I&#8217;m delighted to be working now at a small company with a great team, product, technology, approach, and growth: <a href="http://tigerlead.com/">TigerLead.com</a></p>
<p>I&#8217;m not keen on job titles, but I needed to put <em>something</em> on my <a href="http://www.linkedin.com/in/timbunce">LinkedIn profile</a>. After <a href="http://putthingsoff.com/dont-use-these-job-titles/">exploring</a> <a href="http://positivesharing.com/2007/12/who-cares-about-your-job-title-tell-me-what-you-do/">some</a> <a href="http://www.bullshitjob.com/titles.html">options</a> I settled on &#8220;Entropy Minimizer&#8221;!</p>
<p>I&#8217;m also delighted to be working with the <a href="http://www.postgresql.org/">PostgreSQL</a> database, at last, as I&#8217;ve not had a chance to work with it before. (Although I used to be good at tuning <a href="http://en.wikipedia.org/wiki/INGRES">Ingres</a>, the distant forerunner of PostgreSQL, back in the days when RDBMS were novel and we thought a 50MHz cpu was fast.)</p>
<br />Posted in life, software Tagged: dashprofiler, gofer, nytprof, postgresql, tigerlead <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/timbunce.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/timbunce.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/timbunce.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/timbunce.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/timbunce.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/timbunce.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/timbunce.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/timbunce.wordpress.com/213/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/timbunce.wordpress.com/213/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/timbunce.wordpress.com/213/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=blog.timbunce.org&blog=2562816&post=213&subd=timbunce&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://blog.timbunce.org/2008/12/17/crouching-tiger/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>