<?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"
	>

<channel>
	<title>distributedINFORMATION.com</title>
	<atom:link href="http://distributedinformation.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://distributedinformation.com/blog</link>
	<description>What Sven Dowideit's working on now.</description>
	<pubDate>Sat, 28 Jun 2008 14:12:54 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>defense against the dark arts? (Cross site scripting and Cross Site forgery)</title>
		<link>http://distributedinformation.com/blog/2008/06/29/defense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery/</link>
		<comments>http://distributedinformation.com/blog/2008/06/29/defense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 14:12:54 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[debian]]></category>

		<category><![CDATA[enterprise]]></category>

		<category><![CDATA[twiki]]></category>

		<category><![CDATA[twikiapplication]]></category>

		<category><![CDATA[CSFR]]></category>

		<category><![CDATA[XSS]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/?p=43</guid>
		<description><![CDATA[I was having a discussion with someone on IRC about how TWiki is vulnerable to Cross-site scripting and Cross-site request forgery, and we realized that there are 2 possible approaches to securing TWiki effectively (both requiring a unique magic number for all URLs):

add a pre process to the TWiki::UI system, requiring a valid and unique [...]]]></description>
			<content:encoded><![CDATA[<p>I was having a discussion with someone on IRC about how TWiki is vulnerable to Cross-site scripting and Cross-site request forgery, and we realized that there are 2 possible approaches to securing TWiki effectively (both requiring a unique magic number for all URLs):</p>
<ol>
<li>add a pre process to the TWiki::UI system, requiring a valid and unique magic, and a post process step between rendering and output to the browser</li>
<li>use a small proxy system between TWiki and browsers to add and validate the magic</li>
</ol>
<p>1. is actually still risky as all scripts still are able to output directly to the browser using a =print= statement, thus giving the user urls that may not have a necessary magic in the url, or similarly for AddOns that persist in not using resthandlers.</p>
<p>whereas 2. abstracts the security from the application server, in much the same way as it is for ssl - goodness all round.</p>
<p>So - I wonder if there is such a proxy already?</p>
<p>There are also massive performance reasons why you should always have a proxy between browsers and heavy application servers like TWiki - this too could do with filling out.Securing TWiki is not as simple as converting all actions to POST (ie using proper REST / HTTP) because there are too many legacy conveniences, allowing GET URL&#8217;s to act upon the data. But, by delegating the securing of the transactions to an external wrapper, I think we can avoid these flaws.<br />
see <a href="http://en.wikipedia.org/wiki/Cross-site_scripting">Wikipedia on Cross Site Scripting</a> and <a href="http://en.wikipedia.org/wiki/Cross-site_request_forgery">Cross-site request forgery</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F&amp;title=defense+against+the+dark+arts%3F+%28Cross+site+scripting+and+Cross+Site+forgery%29" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F&amp;title=defense+against+the+dark+arts%3F+%28Cross+site+scripting+and+Cross+Site+forgery%29" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F&amp;title=defense+against+the+dark+arts%3F+%28Cross+site+scripting+and+Cross+Site+forgery%29" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F&amp;title=defense+against+the+dark+arts%3F+%28Cross+site+scripting+and+Cross+Site+forgery%29" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F&amp;title=defense+against+the+dark+arts%3F+%28Cross+site+scripting+and+Cross+Site+forgery%29', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F&amp;title=defense+against+the+dark+arts%3F+%28Cross+site+scripting+and+Cross+Site+forgery%29" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F06%2F29%2Fdefense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery%2F&amp;title=defense+against+the+dark+arts%3F+%28Cross+site+scripting+and+Cross+Site+forgery%29" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/06/29/defense-against-the-dark-arts-cross-site-scripting-and-cross-site-forgery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Firefox 3 pre release builds includes 64bit</title>
		<link>http://distributedinformation.com/blog/2008/05/02/firefox-3-pre-release-builds-includes-64bit/</link>
		<comments>http://distributedinformation.com/blog/2008/05/02/firefox-3-pre-release-builds-includes-64bit/#comments</comments>
		<pubDate>Fri, 02 May 2008 05:17:34 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[debian]]></category>

		<category><![CDATA[new]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/05/02/firefox-3-pre-release-builds-includes-64bit/</guid>
		<description><![CDATA[I&#8217;ve been using firefox 3 on my notebook since beta3, and loving its lower CPU and memory needs, but have been frustrated by the lack of 64 bit builds for my 8Gig RAM desktop development and VMWare system.
It seems that they have been building 64bit binaries for quite some time - see their nightly build [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using firefox 3 on my notebook since beta3, and loving its lower CPU and memory needs, but have been frustrated by the lack of 64 bit builds for my 8Gig RAM desktop development and VMWare system.</p>
<p>It seems that they <em>have</em> been building 64bit binaries for quite some time - see their nightly build dir.. <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/" title="nightly build area">http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/</a></p>
<p>NICE!</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F&amp;title=Firefox+3+pre+release+builds+includes+64bit" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F&amp;title=Firefox+3+pre+release+builds+includes+64bit" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F&amp;title=Firefox+3+pre+release+builds+includes+64bit" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F&amp;title=Firefox+3+pre+release+builds+includes+64bit" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F&amp;title=Firefox+3+pre+release+builds+includes+64bit', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F&amp;title=Firefox+3+pre+release+builds+includes+64bit" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F05%2F02%2Ffirefox-3-pre-release-builds-includes-64bit%2F&amp;title=Firefox+3+pre+release+builds+includes+64bit" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/05/02/firefox-3-pre-release-builds-includes-64bit/feed/</wfw:commentRss>
		</item>
		<item>
		<title>progress towards TWiki 4.2.1 patch release.</title>
		<link>http://distributedinformation.com/blog/2008/04/15/progress-towards-twiki-421-patch-release/</link>
		<comments>http://distributedinformation.com/blog/2008/04/15/progress-towards-twiki-421-patch-release/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 05:57:38 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[new]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[twiki]]></category>

		<category><![CDATA[twikiapplication]]></category>

		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/04/15/progress-towards-twiki-421-patch-release/</guid>
		<description><![CDATA[(test post using Gnome Webog poster)
The last fortnight, I&#8217;ve been working on creating a new, soon to be released to web 2.0 &#8216;Beta&#8217; site based on TWiki 4.2.0. That means that I&#8217;ve been busy finding, reporting and fixing Bugs for TWiki 4.2.1.
The list todate are:
Item5455  	 BuildContrib doesn&#8217;t cope with larger numbers of files [...]]]></description>
			<content:encoded><![CDATA[<p>(test post using Gnome Webog poster)</p>
<p>The last fortnight, I&#8217;ve been working on creating a new, soon to be released to web 2.0 &#8216;Beta&#8217; site based on TWiki 4.2.0. That means that I&#8217;ve been busy finding, reporting and fixing Bugs for TWiki 4.2.1.</p>
<p>The list todate are:</p>
<p>Item5455  	 BuildContrib doesn&#8217;t cope with larger numbers of files  	 Closed  	 15 Apr 2008 - 04:34  	 SvenDowideit</p>
<p>Item5536 	robots.txt is missing some obvious scripts - like login 	Waiting for Release 	14 Apr 2008 - 08:43 	SvenDowideit</p>
<p>Item5535 	IF{&#8221;$BANNER&#8221; does not really work. 	Waiting for Release 	14 Apr 2008 - 06:49 	SvenDowideit</p>
<p>Item5534 	missing contexts for several bin scripts 	Waiting for Release 	14 Apr 2008 - 06:25 	SvenDowideit</p>
<p>Item5533 	tmpl login script does not do writeCompletePage, so it does not get addToHEAD bits. 	Waiting for Release 	14 Apr 2008 - 05:10 	SvenDowideit</p>
<p>Item5513 	update TalkContrib topic 	Closed 	11 Apr 2008 - 06:19 	SvenDowideit</p>
<p>Item5509 	IF &amp; query String matching may be incorrectly greedy. 	Waiting for Release 	11 Apr 2008 - 01:55 	SvenDowideit</p>
<p>Item5501 	IF allows does not work correctly if the topic does not exist. 	Waiting for Release 	11 Apr 2008 - 01:41 	SvenDowideit</p>
<p>Item5510 	initial version of TalkContrib 	Closed 	09 Apr 2008 - 08:11 	SvenDowideit</p>
<p>Item5499 	TWiki::UI::Resister::changePassword sends login, not cUID to TWiki::Users::setPassword 	Waiting for Release 	04 Apr 2008 - 02:24 	SvenDowideit</p>
<p>Item5496 	Conclusion: Turn off UTF-8 test case until bug is fixed (4.2 branch only) 	Waiting for Release 	03 Apr 2008 - 02:06 	SvenDowideit</p>
<p>Item5495 	add twikiBroadcastMessage class div to default &amp; classic skins 	Waiting for Release 	03 Apr 2008 - 00:53 	SvenDowideit</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F&amp;title=progress+towards+TWiki+4.2.1+patch+release." title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F&amp;title=progress+towards+TWiki+4.2.1+patch+release." title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F&amp;title=progress+towards+TWiki+4.2.1+patch+release." title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F&amp;title=progress+towards+TWiki+4.2.1+patch+release." title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F&amp;title=progress+towards+TWiki+4.2.1+patch+release.', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F&amp;title=progress+towards+TWiki+4.2.1+patch+release." title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F04%2F15%2Fprogress-towards-twiki-421-patch-release%2F&amp;title=progress+towards+TWiki+4.2.1+patch+release." title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/04/15/progress-towards-twiki-421-patch-release/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Blead Perl DTrace probes</title>
		<link>http://distributedinformation.com/blog/2008/02/15/blead-perl-dtrace-probes/</link>
		<comments>http://distributedinformation.com/blog/2008/02/15/blead-perl-dtrace-probes/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 07:16:26 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[dtrace]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[solaris]]></category>

		<category><![CDATA[leopard]]></category>

		<category><![CDATA[opensolaris]]></category>

		<category><![CDATA[osx]]></category>

		<category><![CDATA[require]]></category>

		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/02/15/blead-perl-dtrace-probes/</guid>
		<description><![CDATA[I&#8217;ve ported my additional DTrace probes to blead perl, adding the following probes

new-sv and del-sv to track Perl allocations,
main-enter and main-exit to show what part of Perl&#8217;s execution phase  we&#8217;re in
load-module-entry and load-module-return to instrument use, require, do.

I&#8217;ve also started to document the probes at  http://wikis.sun.com/display/DTrace/perl+Provider
To use the patch,

get bleadperl:

 rsync -avz &#8211;exclude [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve <a href="http://distributedinformation.com/DTrace/">ported my additional DTrace</a> probes to blead perl, adding the following probes</p>
<ul>
<li>new-sv and del-sv to track Perl allocations,</li>
<li>main-enter and main-exit to show what part of Perl&#8217;s execution phase  we&#8217;re in</li>
<li>load-module-entry and load-module-return to instrument use, require, do.</li>
</ul>
<p>I&#8217;ve also started to document the probes at  <a href="http://wikis.sun.com/display/DTrace/perl+Provider" class="moz-txt-link-freetext">http://wikis.sun.com/display/DTrace/perl+Provider</a><br />
To use the patch,</p>
<ol>
<li>get bleadperl:
<ol>
<li> rsync -avz &#8211;exclude .svn/ &#8211;delete rsync://ftp.linux.activestate.com/perl-current/ bleadperl</li>
</ol>
</li>
<li>apply the patch:</li>
<li>cd bleadperl ; patch ../bleadperl.diff</li>
<li>run configure with dtrace enabled:
<ol>
<li>./Configure -de -Dusedevel -Dinc_version_list=none -Dprefix=/usr/local/bleadperl/ -Dldflags=-Dman3ext=3pm -Duseithreads -Duseshrplib -Uversiononly -Dusedtrace -Doptimize=-g</li>
</ol>
</li>
<li>make</li>
<li>make test</li>
<li>make install</li>
<li>run./perl.d (also found at <a href="http://distributedinformation.com/DTrace/">http://distributedinformation.com/DTrace/</a> ) and then run whatever Perl code you want to instrument.</li>
</ol>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F15%2Fblead-perl-dtrace-probes%2F&amp;title=Blead+Perl+DTrace+probes" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/02/15/blead-perl-dtrace-probes/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Examining &#8216;use&#8217; and &#8216;require&#8217; with Perl Dtrace</title>
		<link>http://distributedinformation.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/</link>
		<comments>http://distributedinformation.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/#comments</comments>
		<pubDate>Wed, 13 Feb 2008 08:51:59 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[dtrace]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[twiki]]></category>

		<category><![CDATA[leopard]]></category>

		<category><![CDATA[opensolaris]]></category>

		<category><![CDATA[osx]]></category>

		<category><![CDATA[require]]></category>

		<category><![CDATA[solaris]]></category>

		<category><![CDATA[use]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/</guid>
		<description><![CDATA[Given the following functionally similar Perl modules, I was curious what the internal Perl differences in execution were.
To recap -  (from PerlDoc)

Perl use - Imports some semantics into the current package from the named module -   It is exactly equivalent to
    BEGIN { require Module; Module-&#62;import( LIST ); }

Perl [...]]]></description>
			<content:encoded><![CDATA[<p>Given the following functionally similar Perl modules, I was curious what the internal Perl differences in execution were.</p>
<p>To recap -  (from <a href="http://perldoc.perl.org/index-functions.html">PerlDoc</a>)</p>
<ul>
<li>Perl <em>use</em> - Imports some semantics into the current package from the named module -   It is exactly equivalent to
<pre class="verbatim">    BEGIN <span class="s">{</span> <a href="http://perldoc.perl.org/functions/require.html" class="l_k">require</a> <span class="w">Module</span><span class="sc">;</span> <span class="w">Module</span><span class="w">-&gt;import</span><span class="s">(</span> <span class="w">LIST</span> <span class="s">)</span><span class="sc">;</span> <span class="s">}</span></pre>
</li>
<li><span class="s">Perl <em>require</em> - </span>demands that a library file be included if it hasn&#8217;t already been included. There is pseudocode there to suggest that a previously required module (successful or not) would just return the previous result</li>
</ul>
<p>So given a set of modules that don&#8217;t define an import() function, one would expect that there would be little difference.</p>
<table valign="top" width="100%">
<tr>
<td>use Module</td>
<td>require Module</td>
</tr>
<tr>
<td>
<h3>main.pl</h3>
<p><code>use Module1;<br />
use </code><code>Module2;</code><br />
<code>use </code><code>Module1;      # add multiple use's to attempt to simulate having many use statements throughout many modules</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code>use </code><code>Module1;</code><br />
<code><br />
BEGIN {<br />
print "::BEGIN\n";<br />
}</code></p>
<p>Module1::printit();</p>
<h3>Module1.pm</h3>
<p><code>package Module1;</code></p>
<p>BEGIN {<br />
my $test = &#8221;;</p>
<p>print &#8220;<code>Module1</code><code>::BEGIN\n";<br />
}<br />
sub printit {<br />
print "<code>Module1</code><code>::printit\n";</code></code></p>
<p>}<br />
1;</p>
<h3>Module2.pm</h3>
<p><code>package Module2;<br />
use Module1;</code></p>
<p>BEGIN {<br />
print &#8220;Module2::BEGIN\n&#8221;;<br />
}</p>
<p>sub printit {<br />
print &#8220;Module2::printit\n&#8221;;<br />
}</p>
<p>1;</td>
<td>
<h3>main.pl</h3>
<p><code>require</code><code> </code><code>Module1;</code><br />
<code>require MyOtherBegin;<br />
</code><code>require</code><code> </code><code>Module1;</code><br />
<code>require Module1;</code><br />
<code>require Module1;</code><br />
<code>require</code><code> </code><code>Module1;</code><br />
<code>require</code><code> </code><code>Module1;</code><br />
<code>require</code><code> </code><code>Module1;</code><br />
<code><br />
BEGIN {<br />
print "::BEGIN\n";<br />
}</code></p>
<p>MyBegin::printit();</p>
<h3>Module1.pm</h3>
<p><code>package Module1;</code></p>
<p>BEGIN {<br />
my $test = &#8221;;</p>
<p>print &#8220;<code>Module1</code><code>::BEGIN\n";<br />
}</code></p>
<p>sub printit {<br />
print &#8220;<code>Module1::printit\n";</code></p>
<p>}<br />
1;</p>
<h3>Module2.pm</h3>
<p><code>package Module2;<br />
require Module1;</code></p>
<p>BEGIN {<br />
print &#8220;Module2::BEGIN\n&#8221;;<br />
}</p>
<p>sub printit {<br />
print &#8220;Module2::printit\n&#8221;;<br />
}</p>
<p>1;</td>
</tr>
<tr>
<td>
<h3>program output</h3>
<p><code><br />
bash-3.00$ /usr/local/bin/perl main.pl<br />
Module1::BEGIN<br />
Module2::BEGIN<br />
::BEGIN<br />
Module1::printit<br />
</code></td>
<td>
<h3>program output</h3>
<p><code><br />
bash-3.00$ /usr/local/bin/perl main.pl<br />
::BEGIN<br />
Module1::BEGIN<br />
Module2::BEGIN<br />
Module1::printit<br />
</code></td>
</tr>
<tr>
<td>
<h3>dtrace output</h3>
<p><code><br />
== perl ==========================================================<br />
perl*::perl_alloc:main-enter<br />
perl*::perl_alloc:main-exit,  (0/0) (73 uS)<br />
perl*::perl_construct:main-enter<br />
perl*::perl_construct:main-exit,  (12/0) (543 uS)<br />
perl*::perl_parse:main-enter<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (254/2) (3 uS)<br />
--&gt; BEGIN, main.pl<br />
--&gt; BEGIN, Module1.pm<br />
&lt;-- BEGIN, Module1.pm (1/0) (102 uS)<br />
&lt;-- BEGIN, main.pl (60/38) (763 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module2)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module2)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module2.pm) (271/16) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (31/8) (2 uS)<br />
--&gt; BEGIN, Module2.pm<br />
&lt;-- BEGIN, Module2.pm (0/0) (4 uS)<br />
--&gt; BEGIN, Module2.pm<br />
&lt;-- BEGIN, Module2.pm (1/0) (11 uS)<br />
&lt;-- BEGIN, main.pl (67/47) (399 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (285/30) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (299/44) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (313/58) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
&gt;&gt; perl*::Perl_utilize:load-module-start (Module1)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (327/72) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_utilize:load-module-start (Module1)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (341/86) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_utilize:load-module-start (Module1)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (355/100) (2 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (0/0) (3 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (1/0) (10 uS)<br />
perl*::perl_parse:main-exit,  (373/132) (3464 uS)<br />
perl*::perl_run:main-enter<br />
--&gt; printit, Module1.pm<br />
&lt;-- printit, Module1.pm (0/0) (8 uS)<br />
perl*::perl_run:main-exit,  (0/0) (44 uS)<br />
perl*::perl_destruct:main-enter<br />
perl*::perl_destruct:main-exit,  (0/5) (20 uS)<br />
total, total (0/0) (4177 uS)Subs returned from:<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file<br />
1        8        8        8        8        0        0 printit              Module1.pm<br />
1      102      102      102      102        1        0 BEGIN                Module1.pm<br />
2       15        4        7       11        1        0 BEGIN                Module2.pm<br />
9     1190        3      132      763      128       85 BEGIN                main.pl<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file</code></p>
<p>allocations / deallocations (complete program):<br />
(515 /      222) perl</p>
<p>time to run perl:     6389 uS (time on CPU     4177 uS)</td>
<td>
<h3>dtrace output</h3>
<p><code><br />
== perl ==========================================================<br />
perl*::perl_alloc:main-enter<br />
perl*::perl_alloc:main-exit,  (0/0) (71 uS)<br />
perl*::perl_construct:main-enter<br />
perl*::perl_construct:main-exit,  (12/0) (583 uS)<br />
perl*::perl_parse:main-enter<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
&lt;&lt; perl*::Perl_ck_require:load-module-end (Module1.pm) (248/2) (3 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module2)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module2.pm) (252/2) (2 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (253/2) (1 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (254/2) (2 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (255/2) (1 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (256/2) (1 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (257/2) (2 uS)<br />
</code><code>&gt;&gt;</code><code> perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (258/2) (1 uS)<br />
--&gt; BEGIN, main.pl<br />
&lt;-- BEGIN, main.pl (1/0) (100 uS)<br />
perl*::perl_parse:main-exit,  (285/28) (2319 uS)<br />
perl*::perl_run:main-enter<br />
--&gt; BEGIN, Module1.pm<br />
&lt;-- BEGIN, Module1.pm (1/0) (14 uS)<br />
&gt;&gt; perl*::Perl_ck_require:load-module-start (Module1)<br />
</code><code>&lt;&lt;</code><code> perl*::Perl_ck_require:load-module-end (Module1.pm) (69/46) (2 uS)<br />
--&gt; BEGIN, Module2.pm<br />
&lt;-- BEGIN, Module2.pm (1/0) (10 uS)<br />
--&gt; printit, Module1.pm<br />
&lt;-- printit, Module1.pm (0/0) (8 uS)<br />
perl*::perl_run:main-exit,  (99/73) (772 uS)<br />
perl*::perl_destruct:main-enter<br />
perl*::perl_destruct:main-exit,  (0/13) (36 uS)<br />
total, total (0/0) (3814 uS)Subs returned from:<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file<br />
1        8        0        8        8        0        0 printit              Module1.pm<br />
1       10        0       10       10        1        0 BEGIN                Module2.pm<br />
1       14        0       14       14        1        0 BEGIN                Module1.pm<br />
1      100        0      100      100        1        0 BEGIN                main.pl<br />
count  totaltime  mintime  avgtime  maxtime allocs  deallocs  func                 file</code></p>
<p>allocations / deallocations (complete program):<br />
(399 /      114) perl</p>
<p>time to run perl:     5368 uS (time on CPU     3814 uS)</td>
</tr>
</table>
<p>The (1/0) tuples in braces are counts of allocations and deallocations by the Perl interpreter in in that enter-return pair, and execution times are all using DTrace&#8217;s vtimestamp, so are adjusted for time on CPU.</p>
<p>This suggests to me that Perl use and require suffer from the same problems that are encountered when using #include&#8217;s inside header files in large scale C and C++, a massive, un-realized parser mess, due to the re-importation of dependencies for the short term convenience of the developer.</p>
<p>While the require output appears better, none the less (looking at the source code for Perl_ck_require) it does more than a nop the second time around (at minimum, its doing a single allocation, and converting the Module name to a File.pm). It is interesting (scary really) that the use case has many more allocations than the require case, but I presume that has to do with the sillyness of importing code into the same namespace several times. That main.pl&#8217;s BEGIN is parsed&amp;allocated for 9 times, and Module2:BEGIN is parsed&amp;allocated for twice - is not really what I had in mind.</p>
<p>For those of us working with large scale Perl code (in my case TWiki and Catalyst) it seems that there is not enough clarity, and there are opposing concerns for users that run Perl directly, incurring the parse and allocate steps each time, and those using accelerators such as mod_perl and speedy_cgi, who essentially start at the main-run phase (I think).</p>
<p>Reducing the above examples by removing the use or requires from everywhere except the top level main.pl, still shows an unexpected side effect that the use case has 34 more allocations and 26 deallocations - but&#8230; there is less going on. So it is possible, that the inconvenience of needing to manage the Perl module loading at the top level might be worth while, at least until Perl is changed to do what the &#8216;manual&#8217; implies.</p>
<p>Another interesting side effect of replacing use with require, is that it moves the execution of the BEGIN from the parse phase to the execution phase - again reducing the effectiveness of Perl accelerators, but perhaps more inline with simplistic expectations.</p>
<p>Seems to me its time to move to bleadperl, and see if I can offer a fix.</p>
<p>The above tests are done using the dtrace enabled Perl 5.8.8  that is in my <a href="http://distributedinformation.com/svn/projects/dtrace/perl-5.8.8/">svn repository</a>.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F13%2Fexamining-use-and-require-with-perl-dtrace%2F&amp;title=Examining+%26%238216%3Buse%26%238217%3B+and+%26%238216%3Brequire%26%238217%3B+with+Perl+Dtrace" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/02/13/examining-use-and-require-with-perl-dtrace/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TWiki 4.2.0 OpenIDUserContrib Consumer released.</title>
		<link>http://distributedinformation.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/</link>
		<comments>http://distributedinformation.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 07:39:57 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[enterprise]]></category>

		<category><![CDATA[openid]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[twiki]]></category>

		<category><![CDATA[twikiapplication]]></category>

		<category><![CDATA[wiki]]></category>

		<category><![CDATA[4.2.0 web2]]></category>

		<category><![CDATA[authentication]]></category>

		<category><![CDATA[Net::OpenID11]]></category>

		<category><![CDATA[openid consumer]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/</guid>
		<description><![CDATA[
I have just uploaded the OpenIDUserContrib for TWiki 4.2.0. It adds OpenID login and 1.1 Attribute functionalty to TWiki.
Currently, it disables Registration, and limits authentication to OpenID users.
It has the advantage over the OpenIDAuth apache module, that it automatically requests the User&#8217;s OpenId 1.1 attributes like Name, Email address directly from their OpenID identity.
While it [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://twiki.org/p/pub/Plugins/OpenIDUserContrib/WikiRing-TWiki-OpenID.png" style="margin: 20px; float: right" /></p>
<p>I have just uploaded the <a href="http://twiki.org/cgi-bin/view/Plugins/OpenIDUserContrib">OpenIDUserContrib</a> for TWiki 4.2.0. It adds <a href="http://openid.net" rel="nofollow" target="_top">OpenID</a> login and 1.1 Attribute functionalty to TWiki.</p>
<p>Currently, it disables Registration, and limits authentication to OpenID users.</p>
<p>It has the advantage over the OpenIDAuth apache module, that it automatically requests the User&#8217;s OpenId 1.1 attributes like Name, Email address directly from their OpenID identity.</p>
<p>While it trusts the user&#8217;s choice of &#8216;FullName&#8217; registration attribute when displaying who made changes to topics, the TWiki topic source<br />
actually stores the authenticating OpenID URI, thus their user details will be updated from the authentication server next time they log in.</p>
<p>Note that TWiki Topic based Groups are <em>not</em> yet implemented using this Mapper.</p>
<h3> Future directions</h3>
<ul>
<li> add mixing of UserMappers to allow OpenID and &#8216;normal&#8217; TWiki auth</li>
<li> turn TWiki into an OpenID identity server</li>
<li> add Safe Group definition system</li>
<li> add OpenId to TWiki&#8217;s registration process (would require openid auth first, then prefill registration details from any available attributes
<ul>
<li> This will require re-writing of TWiki&#8217;s inbuilt registration system</li>
</ul>
</li>
<li> move the list of Known users and their mapping information from <code>data/OpenIdUsers.txt</code> to somewhere more scalable. (perhaps DBI)
<ul>
<li> combine the info TWiki uses persistently with the Session and other caching info <span class="twikiNewLink">OpenID11<a href="/cgi-bin/edit/Plugins/OpenID11?topicparent=Plugins.OpenIDUserContrib" rel="nofollow" title="Create this topic">?</a></span>  uses</li>
</ul>
</li>
</ul>
<h3>Net::OpenID11 (based on Net::JanRain::OpenID)</h3>
<p>To make this work, I fixed the Perl bugs I found in Net::JanRain::OpenID, and renamed the resulting modules under Net::openID11 (as it is not OpenID2.0). I expect to upload these packages to CPAN some time soon.</p>
<p>If you want to take a look at the code - goto my <a href="http://distributedinformation.com/svn/projects/TWiki/OpenIDUserContrib/">Subversion repository</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released.', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F12%2Ftwiki-420-openidusercontrib-consumer-released%2F&amp;title=TWiki+4.2.0+OpenIDUserContrib+Consumer+released." title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/02/12/twiki-420-openidusercontrib-consumer-released/feed/</wfw:commentRss>
		</item>
		<item>
		<title>TWiki (4.2 final) Microsoft Windows, OSX and rpm (Centos &#038; Fedora Core i386) installers</title>
		<link>http://distributedinformation.com/blog/2008/02/11/twiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers/</link>
		<comments>http://distributedinformation.com/blog/2008/02/11/twiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers/#comments</comments>
		<pubDate>Mon, 11 Feb 2008 03:31:33 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[enterprise]]></category>

		<category><![CDATA[new]]></category>

		<category><![CDATA[twiki]]></category>

		<category><![CDATA[twikiapplication]]></category>

		<category><![CDATA[wiki]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[fedoracore]]></category>

		<category><![CDATA[osx]]></category>

		<category><![CDATA[redhat]]></category>

		<category><![CDATA[rhel]]></category>

		<category><![CDATA[twiki4.2]]></category>

		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/02/11/twiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers/</guid>
		<description><![CDATA[These Windows, OSX, Centos and Fedora Core installers are fully integrated native installers that will update your Computer with perl, apache, rcs and other tools needed to run TWiki on that platform.TWiki 4.2.0 contains many new improvements to TWiki, including a much improved Wysiwyg editor, a structured query engine, a more generic authentication system and [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.home.org.au/pub/Blog/BlogEntry2007x09x21x22x24/logoed_installer.jpg" width="200" height="200" style="float: right" alt="logoed_installer.jpg" />These Windows, OSX, Centos and Fedora Core installers are fully integrated native installers that will update your Computer with perl, apache, rcs and other tools needed to run TWiki on that platform.TWiki 4.2.0 contains many new improvements to TWiki, including a much improved Wysiwyg editor, a structured query engine, a more generic authentication system and at the same time, the Core engine is faster than the previous twiki4 releases.The <a href="http://distributedinformation.com/TWikiInstallers/">TWiki installers</a> include native installs of (only installed if not already)
<ol>
<li> Apache 2.2 (Windows &amp; rpm)</li>
<li>Perl (ActiveState - Windows &amp; native for rpm)</li>
<li> Gnu Grep  (Windows only)</li>
<li> Gnu rcs (All platforms)</li>
<li> <a href="http://twiki.org/cgi-bin/view/Codev.TWikiRelease04x02x00" class="interwikiLink" title="'Codev.TWikiRelease04x02x00' on TWiki.org">TWiki 4.2.0 Release</a>.</li>
</ol>
<p>Please download it, try it out and report your impressions, ideas, bugs and successes here, on TWiki.org, or in the TWiki <a href="http://develop.twiki.org/%7Etwiki4/cgi-bin/view/Bugs/WebHome" class="interwikiLink" title="The TWiki issue tracking site">Bugs</a> system.
<ul>
<li><a href="http://distributedinformation.com/TWikiInstallers/">Windows TWiki installer</a> 4.2.0  (23MB)</li>
<li><a href="http://distributedinformation.com/TWikiInstallers/">Mac OSX TWiki installer</a> (Tiger only I don&#8217;t yet own Leopard - donations welcome) 4.2.0  (2MB)</li>
<li><a href="http://distributedinformation.com/TWikiInstallers/">Centos 4&amp;5 and Fedora Core 5&amp;7</a> 4.2.0  (17MB)</li>
</ul>
<p>Another TWiki innovation brought to you by  distributedINFORMATION  &amp;   <img src="http://www.home.org.au/pub/Blog/BlogEntry2007x09x21x22x24/wikiring.png" width="20" height="20" border="0" /> <a href="http://www.wikiring.com/" target="_top">WikiRing.com</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F&amp;title=TWiki+%284.2+final%29+Microsoft+Windows%2C+OSX+and+rpm+%28Centos+%26%23038%3B+Fedora+Core+i386%29+installers" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F&amp;title=TWiki+%284.2+final%29+Microsoft+Windows%2C+OSX+and+rpm+%28Centos+%26%23038%3B+Fedora+Core+i386%29+installers" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F&amp;title=TWiki+%284.2+final%29+Microsoft+Windows%2C+OSX+and+rpm+%28Centos+%26%23038%3B+Fedora+Core+i386%29+installers" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F&amp;title=TWiki+%284.2+final%29+Microsoft+Windows%2C+OSX+and+rpm+%28Centos+%26%23038%3B+Fedora+Core+i386%29+installers" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F&amp;title=TWiki+%284.2+final%29+Microsoft+Windows%2C+OSX+and+rpm+%28Centos+%26%23038%3B+Fedora+Core+i386%29+installers', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F&amp;title=TWiki+%284.2+final%29+Microsoft+Windows%2C+OSX+and+rpm+%28Centos+%26%23038%3B+Fedora+Core+i386%29+installers" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F02%2F11%2Ftwiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers%2F&amp;title=TWiki+%284.2+final%29+Microsoft+Windows%2C+OSX+and+rpm+%28Centos+%26%23038%3B+Fedora+Core+i386%29+installers" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/02/11/twiki-42-final-microsoft-windows-osx-and-rpm-centos-fedora-core-i386-installers/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Download TWiki Release 4.2.0</title>
		<link>http://distributedinformation.com/blog/2008/01/26/download-twiki-release-420/</link>
		<comments>http://distributedinformation.com/blog/2008/01/26/download-twiki-release-420/#comments</comments>
		<pubDate>Sat, 26 Jan 2008 08:25:43 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[enterprise]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[twiki]]></category>

		<category><![CDATA[twikiapplication]]></category>

		<category><![CDATA[wiki]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/01/26/download-twiki-release-420/</guid>
		<description><![CDATA[With the hard slog done, we&#8217;ve managed to release TWiki 4.2.0.
I will be updating and releasing the TWiki Installers, the TWiki debian package and the OpenID contrib in the next month (I need a little time to recover from the final release rush)
We&#8217;re looking forward to setting up the new release on the new Servers [...]]]></description>
			<content:encoded><![CDATA[<p>With the hard slog done, we&#8217;ve managed to release <a href="http://twiki.org/cgi-bin/view/Codev/TWikiRelease04x02x00">TWiki 4.2.0</a>.</p>
<p>I will be updating and releasing the <a href="http://twiki.org/cgi-bin/view/Codev/TWikiInstaller">TWiki Installers</a>, the <a href="http://twiki.org/cgi-bin/view/Codev/TWikiOnDebian">TWiki debian package</a> and the <a href="http://twiki.org/cgi-bin/view/Plugins/OpenIdUserContrib">OpenID contrib</a> in the next month (I need a little time to recover from the final release rush)</p>
<p>We&#8217;re looking forward to setting up the new release on the new Servers that were donated by Sun to the TWiki project - it&#8217;ll be fun using the DTrace probes to make TWiki faster for everyone before we start the new features for TWiki 5.0.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F&amp;title=Download+TWiki+Release+4.2.0" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F&amp;title=Download+TWiki+Release+4.2.0" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F&amp;title=Download+TWiki+Release+4.2.0" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F&amp;title=Download+TWiki+Release+4.2.0" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F&amp;title=Download+TWiki+Release+4.2.0', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F&amp;title=Download+TWiki+Release+4.2.0" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F26%2Fdownload-twiki-release-420%2F&amp;title=Download+TWiki+Release+4.2.0" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/01/26/download-twiki-release-420/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Perl DTrace load-module probe added - see what module is &#8216;do&#8217;, &#8216;use&#8217; or &#8216;require&#8217;d</title>
		<link>http://distributedinformation.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/</link>
		<comments>http://distributedinformation.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/#comments</comments>
		<pubDate>Sat, 12 Jan 2008 08:45:32 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[dtrace]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[solaris]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/</guid>
		<description><![CDATA[With the load-module probe, you can see at what point modules are loaded using &#8216;do&#8217;, &#8216;use&#8217; or &#8216;require&#8217;.
The following code:
#!/usr/local/bin/perl -w

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
my $post2 = func($initial);
print "$post\n";

do 'call2.pl';
#eval `cat call2.pl`;
#use CGI::Session;

sub func {
    $_[0] =~ s/there/There/;
    [...]]]></description>
			<content:encoded><![CDATA[<p>With the load-module probe, you can see at what point modules are loaded using &#8216;do&#8217;, &#8216;use&#8217; or &#8216;require&#8217;.</p>
<p>The following code:</p>
<pre>#!/usr/local/bin/perl -w

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
my $post2 = func($initial);
print "$post\n";

do 'call2.pl';
#eval `cat call2.pl`;
#use CGI::Session;

sub func {
    $_[0] =~ s/there/There/;
    return $_[0];
}</pre>
<p>produces the following output:</p>
<pre> == call1.pl ==========================================================
  perl*::perl_alloc:main-enter
  perl*::perl_alloc:main-exit,  (0/0) (56 uS)
  perl*::perl_construct:main-enter
  perl*::perl_construct:main-exit,  (12/0) (624 uS)
  perl*::perl_parse:main-enter
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_utilize:load-module-start (strict)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_ck_require:load-module-start (strict)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_ck_require:load-module-end (strict.pm) (3 uS)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_ck_require:load-module-start (Carp)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_ck_require:load-module-end (Carp.pm) (2 uS)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_dofile:load-module-start (call2.pl)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_dofile:load-module-end (call2.pl) (3 uS)
  perl*::perl_parse:main-exit,  (299/46) (3069 uS)
  perl*::perl_run:main-enter
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_utilize:load-module-start (strict)
&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; perl*::Perl_ck_require:load-module-start (strict)
&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; perl*::Perl_ck_require:load-module-end (strict.pm) (3 uS)
  perl*::perl_run:main-exit,  (69/45) (533 uS)
  perl*::perl_destruct:main-enter
  perl*::perl_destruct:main-exit,  (0/3) (24 uS)</pre>
<p>see <a href="http://trac.distributedinformation.com/index.cgi/timeline">my perl5.8 trac</a> for the code -or grab <a href="http://distributedinformation.com/svn/projects/dtrace/perl-5.8.8/">the modified 5.8.8 source from svn</a></p>
<p>the  perl*::Perl_utilize:load-module-end probe is currently being worked on, and I really would like to see the actual parse component of the load separated out.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+-+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+-+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+-+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+-+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+-+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+-+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2008%2F01%2F12%2Fperl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required%2F&amp;title=Perl+DTrace+load-module+probe+added+-+see+what+module+is+%26%238216%3Bdo%26%238217%3B%2C+%26%238216%3Buse%26%238217%3B+or+%26%238216%3Brequire%26%238217%3Bd" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2008/01/12/perl-dtrace-load-module-probe-added-see-what-module-is-do-use-or-required/feed/</wfw:commentRss>
		</item>
		<item>
		<title>DTrace shows that readable Perl code is fastest.</title>
		<link>http://distributedinformation.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/</link>
		<comments>http://distributedinformation.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/#comments</comments>
		<pubDate>Sat, 29 Dec 2007 11:16:05 +0000</pubDate>
		<dc:creator>Sven Dowideit</dc:creator>
		
		<category><![CDATA[dtrace]]></category>

		<category><![CDATA[perl]]></category>

		<category><![CDATA[solaris]]></category>

		<category><![CDATA[calling conventions]]></category>

		<category><![CDATA[dtrace probes]]></category>

		<category><![CDATA[style]]></category>

		<guid isPermaLink="false">http://distributedinformation.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/</guid>
		<description><![CDATA[I always wondered why some people write unreadable Perl. The most common reason given seems to be &#8216;Its faster that way&#8217;.
And so&#8230; using DTrace, and the extra probes (see the subversion repository with a patched Perl 5.8.8) I added, I thought I&#8217;d take a look.

# dtrace -l &#124; grep perl
85614   perl1226   [...]]]></description>
			<content:encoded><![CDATA[<p>I always wondered why some people write unreadable Perl. The most common reason given seems to be &#8216;Its faster that way&#8217;.</p>
<p>And so&#8230; using DTrace, and the extra probes (see the <a href="http://distributedinformation.com/svn/projects/dtrace/perl-5.8.8/">subversion repository with a patched Perl 5.8.8</a>) I added, I thought I&#8217;d take a look.</p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
# dtrace -l | grep perl
85614   perl1226        libperl.so                      Perl_sv_free del_sv
85615   perl1226        libperl.so                   Perl_sv_replace del_sv
85616   perl1226        libperl.so                          perl_run main_enter
85617   perl1226        libperl.so                        perl_parse main_enter
85618   perl1226        libperl.so                     perl_destruct main_enter
85619   perl1226        libperl.so                    perl_construct main_enter
85620   perl1226        libperl.so                        perl_alloc main_enter
85621   perl1226        libperl.so                          perl_run main_exit
85622   perl1226        libperl.so                        perl_parse main_exit
85623   perl1226        libperl.so                     perl_destruct main_exit
85624   perl1226        libperl.so                    perl_construct main_exit
85625   perl1226        libperl.so                        perl_alloc main_exit
85626   perl1226        libperl.so                       Perl_sv_dup new_sv
85627   perl1226        libperl.so                      Perl_newSVrv new_sv
85628   perl1226        libperl.so                      Perl_newSVsv new_sv
85629   perl1226        libperl.so                  Perl_newRV_noinc new_sv
85630   perl1226        libperl.so                      Perl_newSVuv new_sv
85631   perl1226        libperl.so                      Perl_newSViv new_sv
85632   perl1226        libperl.so                      Perl_newSVnv new_sv
85633   perl1226        libperl.so                    Perl_vnewSVpvf new_sv
85634   perl1226        libperl.so               Perl_newSVpvn_share new_sv
85635   perl1226        libperl.so                     Perl_newSVhek new_sv
85636   perl1226        libperl.so                     Perl_newSVpvn new_sv
85637   perl1226        libperl.so                      Perl_newSVpv new_sv
85638   perl1226        libperl.so                 Perl_sv_newmortal new_sv
85639   perl1226        libperl.so                Perl_sv_mortalcopy new_sv
85640   perl1226        libperl.so                        Perl_newSV new_sv
85641   perl1226        libperl.so                      Perl_pp_sort sub-entry
85642   perl1226        libperl.so                   Perl_pp_dbstate sub-entry
85643   perl1226        libperl.so                  Perl_pp_entersub sub-entry
85644   perl1226        libperl.so                      Perl_pp_last sub-return
85645   perl1226        libperl.so                    Perl_pp_return sub-return
85646   perl1226        libperl.so                     Perl_dounwind sub-return
85647   perl1226        libperl.so                Perl_pp_leavesublv sub-return
85648   perl1226        libperl.so                  Perl_pp_leavesub sub-return</pre>
<p>Using these probes, we can write some &#8216;D&#8217; that tells us what Perl is doing at each of its phases - startup, parsing, execution, and cleanup.</p>
<p>First off, accessing function call parameters:</p>
<p>Given <a href="http://distributedinformation.com/svn/projects/dtrace/blog1/">3 essentially identical programs</a></p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
print "$post\n";

sub func {
    $_[0] =~ s/there/There/;
    return $_[0];
}</pre>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
print "$post\n";

sub func {
    my ($val) = @_;
    $val =~ s/there/There/;
    return $val;
}</pre>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
my $post = func($initial);
print "$post\n";

sub func {
    my $val = shift;
    $val =~ s/there/There/;
    return $val;
}</pre>
<p>There is a myth that using $_[0] is faster, as it doesn&#8217;t create a temporary variable&#8230;<br />
Dtrace (using the <a href="http://distributedinformation.com/svn/projects/dtrace/blog1/perl.d">general perl stats gathering dtrace script</a>) shows this to be untrue:</p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
== call1.pl ==========================================================
  perl*::perl_alloc:main_enter
  perl*::perl_alloc:main_exit,  (0/0) (53119 nS)
  perl*::perl_construct:main_enter
  perl*::perl_construct:main_exit,  (12/0) (564370 nS)
  perl*::perl_parse:main_enter
   --&gt; BEGIN, ./call1.pl
    --&gt; bits, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- bits, /usr/local/lib/perl5/5.8.8/strict.pm (3/2) (48060 nS)
    --&gt; import, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- import, /usr/local/lib/perl5/5.8.8/strict.pm (1/0) (15398 nS)
   &lt;-- BEGIN, ./call1.pl (160/80) (1025874 nS)
  perl*::perl_parse:main_exit,  (299/42) (2856399 nS)
  perl*::perl_run:main_enter
   --&gt; func, ./call1.pl
   &lt;-- func, ./call1.pl (1/0) (47723 nS)
  perl*::perl_run:main_exit,  (0/1) (265677 nS)
  perl*::perl_destruct:main_enter
  perl*::perl_destruct:main_exit,  (0/2) (20763 nS)
total, total (0/0) (3789064 nS)
== call2.pl ==========================================================
  perl*::perl_alloc:main_enter
  perl*::perl_alloc:main_exit,  (0/0) (53251 nS)
  perl*::perl_construct:main_enter
  perl*::perl_construct:main_exit,  (12/0) (509684 nS)
  perl*::perl_parse:main_enter
   --&gt; BEGIN, ./call2.pl
    --&gt; bits, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- bits, /usr/local/lib/perl5/5.8.8/strict.pm (3/2) (36748 nS)
    --&gt; import, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- import, /usr/local/lib/perl5/5.8.8/strict.pm (1/0) (9797 nS)
   &lt;-- BEGIN, ./call2.pl (160/80) (924250 nS)
  perl*::perl_parse:main_exit,  (299/38) (2545953 nS)
  perl*::perl_run:main_enter
   --&gt; func, ./call2.pl
   &lt;-- func, ./call2.pl (1/0) (42165 nS)
  perl*::perl_run:main_exit,  (0/1) (142393 nS)
  perl*::perl_destruct:main_enter
  perl*::perl_destruct:main_exit,  (0/2) (20851 nS)
total, total (0/0) (3301007 nS)
== call3.pl ==========================================================
  perl*::perl_alloc:main_enter
  perl*::perl_alloc:main_exit,  (0/0) (52927 nS)
  perl*::perl_construct:main_enter
  perl*::perl_construct:main_exit,  (12/0) (607783 nS)
  perl*::perl_parse:main_enter
   --&gt; BEGIN, ./call3.pl
    --&gt; bits, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- bits, /usr/local/lib/perl5/5.8.8/strict.pm (3/2) (37066 nS)
    --&gt; import, /usr/local/lib/perl5/5.8.8/strict.pm
    &lt;-- import, /usr/local/lib/perl5/5.8.8/strict.pm (1/0) (10171 nS)
   &lt;-- BEGIN, ./call3.pl (160/80) (924824 nS)
  perl*::perl_parse:main_exit,  (297/37) (2543981 nS)
  perl*::perl_run:main_enter
   --&gt; func, ./call3.pl
   &lt;-- func, ./call3.pl (1/0) (41833 nS)
  perl*::perl_run:main_exit,  (0/1) (140527 nS)
  perl*::perl_destruct:main_enter
  perl*::perl_destruct:main_exit,  (0/2) (20273 nS)
total, total (0/0) (3395310 nS)

allocations / deallocations:
     474 /      122 call3.pl
     476 /      123 call2.pl
     476 /      127 call1.pl</pre>
<p>Counting up the number of allocations and deallocations in the (0/1) output - and<br />
&#8220;&lt;&#8211; func, ./call2.pl (1/0) &#8221; is always the same&#8230; one allocation.</p>
<p>After all the test runs, I also print out the total allocations for the script,<br />
and it seems that the &#8220;my $val = shift&#8221; version is the most efficient -<br />
using two fewer allocations (apparently during the parse phase).</p>
<p>The deallocation count is interesting too - with &#8220;$_[0]&#8221; using 5 more deallocations during<br />
the parse phase and &#8220;my ($val) = @_;&#8221; using one more than the &#8220;my $val = shift&#8221; option.</p>
<p>In an attempt to reduce the allocations doesn&#8217;t seem to help - the following code resulting in 474 allocations,<br />
shift case, but with 3 extra deallocations, again in the parsing phase. Increasing the number of times that func<br />
is called only increases the benefits of using shift.</p>
<pre style="border-left: 1px solid black; font-size: 8pt; margin-left: 50px; padding-left: 10px">
#!/usr/local/bin/perl -Tw

use strict;

my $initial = "there once was a fish. Its feet were small";
$_ = $initial;
my $post = func();
print "$post\n";

sub func {
    s/there/There/;
    return $_;
}</pre>
<p>Interestingly, &#8220;my $val = shift&#8221;  is not only the fastest of the conventions tested, but it also seems that none of the conventions tested cause allocations at run time - they are all done during the parse phase. I guess I&#8217;ll have to construct a more complex case, using references / hashes - next time <img src='http://distributedinformation.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest.', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://del.icio.us/favicon.ico" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fdistributedinformation.com%2Fblog%2F2007%2F12%2F29%2Fdtrace-shows-that-readable-perl-code-is-fastest%2F&amp;title=DTrace+shows+that+readable+Perl+code+is+fastest." title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://distributedinformation.com/blog/2007/12/29/dtrace-shows-that-readable-perl-code-is-fastest/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
