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

<channel>
	<title>Left 404</title>
	<atom:link href="http://left404.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://left404.com</link>
	<description>Adrift in the 21st Century</description>
	<lastBuildDate>Wed, 25 Jan 2012 05:19:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Behind Schedule</title>
		<link>http://left404.com/2012/01/23/behind-schedule/</link>
		<comments>http://left404.com/2012/01/23/behind-schedule/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 11:46:31 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Daily Photo]]></category>

		<guid isPermaLink="false">http://left404.com/?p=958</guid>
		<description><![CDATA[After a surprise storm in late October, downstate New York hadn&#8217;t seen any real snow until yesterday.  Admittedly many people prefer it that way (it sure makes driving easier), but I&#8217;m of the view that you can&#8217;t have a genuine east coast winter without the stuff.  Besides, without the snow the countryside just looks bare [...]]]></description>
			<content:encoded><![CDATA[<p>After a surprise storm in late October, downstate New York hadn&#8217;t seen any real snow until yesterday.  Admittedly many people prefer it that way (it sure makes driving easier), but I&#8217;m of the view that you can&#8217;t have a genuine east coast winter without the stuff.  Besides, without the snow the countryside just looks bare and dreary.</p>
<p>For now though, winter is back on schedule.  There were even people out skiing at Rockefeller State Park.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="P1220455.jpg" src="http://left404.com/wp-content/uploads/2012/01/P1220455.jpg" border="0" alt="Rockefeller - Lake" width="600" height="450" /></p>
<p>Swan Lake &#8211; Frozen and Snowed Over.</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2012/01/23/behind-schedule/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In Memory of Carol</title>
		<link>http://left404.com/2012/01/22/in-memory-of-carol/</link>
		<comments>http://left404.com/2012/01/22/in-memory-of-carol/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 04:23:05 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Daily]]></category>

		<guid isPermaLink="false">http://left404.com/?p=962</guid>
		<description><![CDATA[Today I went to the memorial for Carol, one of my grandmother&#8217;s best friends.  Carol passed away last month after a long illness. It&#8217;s hard to know what to say at such an event.  Words seem painfully inadequate.  She was an extraordinary person in many ways, but above all she had a knack for bringing [...]]]></description>
			<content:encoded><![CDATA[<p>Today I went to the memorial for Carol, one of my grandmother&#8217;s best friends.  Carol passed away last month after a long illness.</p>
<p>It&#8217;s hard to know what to say at such an event.  Words seem painfully inadequate.  She was an extraordinary person in many ways, but above all she had a knack for bringing cheer and joy wherever she went.  In our hurried, impersonal world, that is indeed a rare gift.</p>
<p>One of the more poignant moments at the memorial came when her close friend explained that Carol had said previously that she didn&#8217;t want any memorial to be held.  &#8221;I know.  But it&#8217;s not for you.  It&#8217;s for us,&#8221; the friend replied.  And it was.</p>
<p>Goodbye Carol.</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2012/01/22/in-memory-of-carol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Site anniversary</title>
		<link>http://left404.com/2012/01/20/site-anniversary/</link>
		<comments>http://left404.com/2012/01/20/site-anniversary/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 04:51:55 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Daily]]></category>

		<guid isPermaLink="false">http://left404.com/?p=960</guid>
		<description><![CDATA[It&#8217;s hard to believe that I made my first post to this site&#8217;s predecessor (myownlittleworld) exactly ten years ago.  The site has had its ups and downs since, much the same as its author, but I&#8217;m hoping it will still be going strong ten years from now. Looking back at old posts and the memories [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s hard to believe that I made my first post to this site&#8217;s predecessor (myownlittleworld) exactly ten years ago.  The site has had its ups and downs since, much the same as its author, but I&#8217;m hoping it will still be going strong ten years from now.</p>
<p>Looking back at old posts and the memories they conjure up, I recognize the skinny, sharp, cynical, occasionally confused kid who posted his musings on these digital pages.  I&#8217;m not sure quite what he&#8217;d think of the current version of me, but I hope wouldn&#8217;t be too terribly disappointed.</p>
<p>And if I could send a message to that fellow (not that he would have listened!) what with hindsight being a benefit and all, it would have been: Don&#8217;t take yourself (or anybody else) so seriously.  Life is just too short.*</p>
<p>*Seriousness is a leading cause of chronic overcautiousness among other damaging neuroses.  Such a condition, if untreated by ample quantities of levity and silliness, frequently degenerates into a state known as &#8216;being a tiresome bore.&#8217;</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2012/01/20/site-anniversary/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>They Deserve to Lose</title>
		<link>http://left404.com/2012/01/18/they-deserve-to-lose/</link>
		<comments>http://left404.com/2012/01/18/they-deserve-to-lose/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 04:57:01 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://left404.com/?p=955</guid>
		<description><![CDATA[I try to avoid saying too much about politics.  This is partly because most of the time others have already said what I would have said, and said it better than I could have.  In truth though, I steer clear of political posts because I really have nothing nice to say, and who wants to [...]]]></description>
			<content:encoded><![CDATA[<p>I try to avoid saying too much about politics.  This is partly because most of the time others have already said what I would have said, and said it better than I could have.  In truth though, I steer clear of political posts because I really have nothing nice to say, and who wants to be Cassandra anyway?</p>
<p>Still, given that the 2012 &#8216;election-cycle&#8217; is almost upon us, and given the absurd spectacle we are now greeted with, now seems as good a time as any to say what I think, and what I think (writ large) is:</p>
<p style="text-align: center;">The Democrats deserve to lose this election.</p>
<p> </p>
<p><span id="more-955"></span>
<p>Let us return briefly to the jubilant scene just three years ago when Barack Obama, surrounded by millions of cheering Americans, was inaugurated as the next president of the United States.</p>
<p>It was a moment to remember.  Beyond the symbolism of an African-American, the son of a single mother winning the most powerful elected office in the land, there was the political facts.  For the first time since 1994, the Democrats would control both houses of Congress and the White House.  For the first time since 1976, a Democratic presidential candidate had won more than half the popular vote.</p>
<p>Meanwhile, the opposition Republican party was weakened and directionless.  A Republican president had just presided over beginning of the largest economic crisis since the Great Depression.  They suffered damaging losses in Congress, including their entire New England house contingent.  So-called independents broke decisively against Republicans, as did young people, women, Latinos and African Americans.  The party appeared in danger of becoming the party of aging white men.  The finger-pointing and recriminations among the leadership were non-stop.</p>
<p>Even the traditional anti-Democratic sources were uncharacteristically silent.  The economic collapse had weakened Wall Street, leaving it temporarily silent.  Most big businesses were worried about their own problems, unable or unwilling to rock the boat.</p>
<p>In short, we not only had an eloquent new president with a compelling life-story on our hands, we had a once-in-a-generation political opportunity as a hugely popular president backed by large Congressional majorities faced a frightened and fragmented opposition.  Not since the days of Lyndon Johnson had liberals had such strong reasons to hope for the legislative enactment of a progressive social agenda.</p>
<p>Alas, it was not to be.  Congressional leaders fell to squabbling.  The president refused to get his hands dirty in the legislating process, allowing important bills to languish in Congressional committees.  Meanwhile, the economic distress continued, and the president&#8217;s conservative economic policies had little visible positive impact.  The lack of progress and change left many voters confused and disheartened, as did the reemergence of a Republican opposition determined to block the president at every turn.  In the 2010 midterm elections, Democrats were swamped, and all hope for major progress legislation died with the end of the 111th Congress.</p>
<p>While there are many reasons for this failure, the primary one was a failure in leadership.  The president did not lead.  He did not seize the political moment.  He did not effectively use his majorities and popularity when he had them and now they are gone.</p>
<p>Fundamentally, the Obama presidency&#8217;s lack of leadership is underlaid by a profound political naiveté.  Unable or unwilling to see the opposition for what it was, he wasted precious time and political capital soliciting their input, meeting their leaders, and negotiating with them when he did not have to.  It takes a special lack of savvy to fall victim to the same trick again and again, but that is precisely what Obama has done.  Unwilling to call a spade a spade, he has negotiated repeatedly with people whose primary goal is to see him fail.  He has played directly into their hands, and now he is suffering the consequences.</p>
<p>Politics is war.  You gain no credit for being a gentleman.  There&#8217;s no &#8216;A&#8217; for effort.  Results are the only metric by which one is judged.  The president should have taken his political capital and spent it ramming through legislation rather than dallying in meetings with people whose votes he would never get.  Rather than compromise, he should have fought for the most liberal legislation that had any decent chance of passage.</p>
<p>Moreover, he should have used whatever advantages he had to weaken the opposition.  Why not &#8216;go nuclear&#8217; and end the filibuster once and for all?  Why not fill all vacant judgeships with the most liberal judges available through recess appointments?  Why not pass a truly massive stimulus, investing directly in transportation and energy, and funded by a revamped tax-code that raises marginal tax rates on the well off back the 1960 levels?  Why not push through immigration reform, including fast-tracking citizenship for immigrants in good standing (most will Democratic)?  Why not reduce disproportionate federal aid and pork to Republican-friendly districts?  Why not purge the SEC of corrupt former Wall-streeters and target the wizards behind the financial instruments that led to the meltdown?  Why not break up the institutions deemed &#8216;too big to fail&#8217;?  Why not allow regular Americans to opt into the same healthcare plan that Congress has?</p>
<p>I&#8217;m no savvy career politician, but it doesn&#8217;t take a genius to see that Obama, for all his inspiration, was the wrong man for the job.  The lack of leadership, the lack of combativeness and the unwillingness to pull out all the stops have all proven fatal.  All in all, the president and the Democrats simply don&#8217;t seem to be willing to do what&#8217;s necessary to make real change happen.  Perhaps that&#8217;s a feature, or perhaps that&#8217;s a bug, but the truth of the matter is that makes them failures on two fronts: they are neither competent enough to destroy the opposition, nor are they courageous enough to get done what needs to be done.</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2012/01/18/they-deserve-to-lose/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Winter Daze</title>
		<link>http://left404.com/2011/12/28/winter-daze/</link>
		<comments>http://left404.com/2011/12/28/winter-daze/#comments</comments>
		<pubDate>Thu, 29 Dec 2011 01:20:35 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Daily Photo]]></category>

		<guid isPermaLink="false">http://left404.com/?p=949</guid>
		<description><![CDATA[In spite of the early snowstorm at the end of October, it&#8217;s actually been a very warm winter here in New York so far.  Feels a lot like winter on the west coast, except warmer.  On the bright side, the days are starting to get longer, albeit very slowly. Here is the view from lower [...]]]></description>
			<content:encoded><![CDATA[<p>In spite of the early snowstorm at the end of October, it&#8217;s actually been a very warm winter here in New York so far.  Feels a lot like winter on the west coast, except warmer.  On the bright side, the days are starting to get longer, albeit very slowly.</p>
<p>Here is the view from lower Manhattan on a gray, blustery morning.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" title="PC280235.jpg" src="http://left404.com/wp-content/uploads/2011/12/PC280235.jpg" border="0" alt="Stormy skies" width="600" height="450" /></p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2011/12/28/winter-daze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Air Travel</title>
		<link>http://left404.com/2011/12/26/air-travel/</link>
		<comments>http://left404.com/2011/12/26/air-travel/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 22:34:39 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://left404.com/?p=953</guid>
		<description><![CDATA[It&#8217;s no big secret that air travel in general has become a lot less fun than it used to be.  Shrinking seats, escalating fees, and of course the ever-increasing list of &#8216;security&#8217; procedures foisted upon us by the good folks of the TSA and the Department of Hopeless Stupidity. The whole situation seems to have [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s no big secret that air travel in general has become a lot less fun than it used to be.  Shrinking seats, escalating fees, and of course the ever-increasing list of &#8216;security&#8217; procedures foisted upon us by the good folks of the TSA and the Department of Hopeless Stupidity.</p>
<p>The whole situation seems to have disintegrated long past the point of parody, with disabled toddlers being groped by TSA agents and holiday cupcakes being confiscated as contraband, but there we are.</p>
<p><span id="more-953"></span>
<p>What makes the &#8216;security&#8217; edicts of the DHS and TSA so pernicious is that while it is fairly easy to add new restrictions, it is all but impossible to discontinue existing ones.  Any sane discussion of efficacy or utility is invariably shutdown at the first mention of &#8217;9/11&#8242;.</p>
<p>Aside from the casual dismissal of basic rights and common sense, air travel &#8216;security&#8217; is also a ridiculously expensive endeavor, that has yielded no tangible returns.  When asked, the TSA is unable to point to a single case where its screenings have actually resulted in the apprehension of a would-be terrorist.  In the meantime, over $1 trillion has been spent on this security theater, which has been proven time and time again to be unable to catch even major security breaches (guns and explosives in carry on baggage, fake boarding passes and IDs, etc.).</p>
<p>The wasting of vast sums of money, the reflexive dismissal of legitimate concerns and the overall arrogance and unpleasantness of the whole arrangement leaves a very bad taste.  I&#8217;ve done my best to curtail my own air travel, and to seek alternatives wherever possible.  It doesn&#8217;t look likely that the situation will improve in the foreseeable future, but hopefully as more people vote with their feet and wallets, the alternatives will improve.</p>
<p>I&#8217;m not generally a &#8216;government has to go&#8217; type, but the DHS and TSA are clearly examples of self-sustaining bureaucracies with no genuine value save perhaps to the people who it employs.  Accordingly, anybody who runs on a platform of ending them has my vote.</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2011/12/26/air-travel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>strlang</title>
		<link>http://left404.com/2011/12/26/strlang/</link>
		<comments>http://left404.com/2011/12/26/strlang/#comments</comments>
		<pubDate>Mon, 26 Dec 2011 11:35:29 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://left404.com/?p=944</guid>
		<description><![CDATA[strlang &#8211; a simple language for string manipulation strlang is a programming language I created with the goal of making string manipulation simple and straightforward.  It is an imperative language with a minimalist syntax.  The language and its compiler were written as part of the Programming Languages and Translators (COMS 4115) course at Columbia University [...]]]></description>
			<content:encoded><![CDATA[<p><strong>strlang</strong> &#8211; a simple language for string manipulation</p>
<p>strlang is a programming language I created with the goal of making string manipulation simple and straightforward.  It is an imperative language with a minimalist syntax.  The language and its compiler were written as part of the Programming Languages and Translators (COMS 4115) course at Columbia University in Fall 2011.</p>
<p><strong>Features</strong></p>
<ol>
<li>Basic data types are strings, numbers and maps (sets of key-value pairs)</li>
<li>Full-set of operators for arithmetic, string manipulation (including basic regular expressions) and map construction</li>
<li>C-like structure including functions, loops, conditionals and expressions</li>
<li>No keywords</li>
</ol>
<p> </p>
<p><span id="more-944"></span>
<p>The <strong>strlang</strong> compiler performs syntax and static-semantic checking.  Valid programs are compiled to a linearized form of C++ (only one block per function, all operands are stored in variables, loops and conditionals are simplified to labels and jumps).  The compiler itself is written in OCaml and comes with a testsuite.  It relies on the C++ STL for its underlying data-types, and the <a href="http://www.pcre.org">PCRE library</a> for regular expression support.</p>
<p>Documentation, including a tutorial and a language reference manual, is included in the source distribution.  Building strlang requires a current OCaml distribution.  To use it, you will also need a working C++ compiler and STL installation as well as an installation of the PCRE library.</p>
<p>Overview: <strong><a href="http://left404.com/wp-content/uploads/2011/12/strlang-slides.pdf">strlang-slides.pdf</a></strong> &#8211; 1.4MB<br />Download: <strong><a href="http://left404.com/wp-content/uploads/2011/12/strlang-0.1.tar.gz">strlang-0.1.tar.gz</a></strong> &#8211; 1.5MB</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2011/12/26/strlang/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Winter Revisited</title>
		<link>http://left404.com/2011/12/16/winter-revisited/</link>
		<comments>http://left404.com/2011/12/16/winter-revisited/#comments</comments>
		<pubDate>Fri, 16 Dec 2011 15:53:05 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Photo]]></category>

		<guid isPermaLink="false">http://left404.com/?p=940</guid>
		<description><![CDATA[This photo is from last year, descending White Mountain Peak in eastern California in the middle of October.  Meanwhile it&#8217;s 50 degrees and sunny outside my window here in New York in mid-December. One of the benefits of being on the east coast is that we do have four full seasons.  Of course as my [...]]]></description>
			<content:encoded><![CDATA[<p><img title="DSC_5851.jpg" src="http://left404.com/wp-content/uploads/2011/12/DSC_5851.jpg" border="0" alt="White Mountains" width="600" height="399" /></p>
<p>This photo is from last year, descending White Mountain Peak in eastern California in the middle of October.  Meanwhile it&#8217;s 50 degrees and sunny outside my window here in New York in mid-December.</p>
<p>One of the benefits of being on the east coast is that we do have four full seasons.  Of course as my photo suggests, you can have seasons in California too.  You just may need to drive to a different part of the state to see them.</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2011/12/16/winter-revisited/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bytecode v. Native Code &#8211; calculating pi</title>
		<link>http://left404.com/2011/12/01/bytecode-v-native/</link>
		<comments>http://left404.com/2011/12/01/bytecode-v-native/#comments</comments>
		<pubDate>Fri, 02 Dec 2011 02:40:42 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://left404.com/?p=925</guid>
		<description><![CDATA[Prologue Like many folks who began using Java around ten years ago, I found it very useful with two exceptions: it forced you to use objects for everything, and it was slow. Since then, nothing much has changed about the object-oriented nature of Java, although some of the more annoying limitations of the early days [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Prologue</strong></p>
<p>Like many folks who began using Java around ten years ago, I found it very useful with two exceptions: it forced you to use objects for everything, and it was slow.</p>
<p>Since then, nothing much has changed about the object-oriented nature of Java, although some of the more annoying limitations of the early days have been more or less dealt with.</p>
<p><span id="more-925"></span></p>
<p>The more serious concern has generally been performance.  Java was slow.  The reason why isn&#8217;t exactly a mystery.  Java programs compile to byte-code.  C and C++ programs compile to native code.  Whereas running a compiled C program is more or less a straightforward matter of executing one instruction after another, running a compiled Java program means running the Java byte code through an interpreter on the Java virtual machine.  The interpreter has been made more clever over the years (it&#8217;s now a so-called Just-In-Time Compiler &#8211; JITC), but the basic principle remained.  Java added another level of abstraction to running programs, and abstraction is not free.</p>
<p>A few years ago, I converted my favorite pi calculating benchmark to Java and ran it with the then current tools (JDK 1.3 if I recall correctly).  It was slower than the native C version, but not enormously so.</p>
<p><strong>Developments</strong></p>
<p>Since then several things have changed.  First, Microsoft&#8217;s .NET platform has become more than an odd curiosity.  Like Java, .NET is basically a large runtime library packaged with a virtual machine (CLR) and its own bytecode format (called CIL).  Interestingly, Microsoft encourages not only users of their C# Java clone, but also users of C/C++ to target this platform.  In other words, your C++ programs can now also be compiled to run in a virtual machine.</p>
<p>Meanwhile, Sun (now Oracle) and all the C/C++ compiler projects have continued to work on improving performance.  Intel in particular is on roll, seemingly adding a dozen new specialized instructions every year to their microprocessors, and then figuring out clever ways their compilers can take advantage of these.  SSE2, SSE3, PNI, AVX, and whatnot.</p>
<p><strong>The Test</strong></p>
<p>The pi_css5 benchmark uses floating point arithmetic and fast-fourier transforms to efficiently compute large numbers of digits of pi.  It makes no use of special object-oriented features, and was written originally in ANSI C.  Happily, the code is portable and with a little massaging can be used with pretty much any C++, Java or .NET compiler.  The actual test consists simply of running the program to compute 4 million digits of pi.</p>
<p>All measurements were performed on a 1.8GHZ Intel Core i5 processor running Windows XP.  Measurements are of time to execute (lower is better).</p>
<p><strong>Setup</strong></p>
<p>The Java code was compiled with the earliest Java compiler I could find (JDK 1.1.8) and run under the various JVM versions.  JDK 1.1 was released in early 2000.  The current version as of late 2011 is JDK 1.7.  Interestingly, using bytecode compiled with newer versions of the JDK made no difference in performance.</p>
<p>The C# code was compiled with Microsoft Visual C# 2010.  This code was run in the current 4.0 release of the .NET environment.</p>
<p>The C++ code was compiled with Visual C++ 2010 and Intel C++ 12.  As Visual C++ 2010 allows you to target both .NET (CLR) generating bytecode, or x86 directly by producing machine code, I tried both versions.</p>
<p>The Java code was also tested in the IKVM virtual machine.  IKVM is a peculiar Java Virtual Machine which executes inside the .NET virtual machine.  In other words, it translate Java bytecode to .NET bytecode aka CIL.</p>
<p><img style="display: block; margin-left: auto; margin-right: auto; border: 0px initial initial;" title="pi_bytecode.jpg" src="http://left404.com/wp-content/uploads/2011/12/pi_bytecode.jpg" alt="bytecode" width="545" height="329" border="0" /><strong></strong></p>
<p><strong>Observations</strong></p>
<p>1) Java has made substantial performance improvements.  Specifically, the JIT in JDK 1.6 and later is within spitting distance (10%) of the optimized x86 code produced by Microsoft&#8217;s Visual C++.  Given that MSVC++ is probably the most widely used C++ compiler available, that&#8217;s quite an achievement.</p>
<p>2) There&#8217;s a penalty for using C# over C++ with .NET.  This is surprising considering that the bytecode ought to look quite similar (floating point addition, multiplication and whatnot, combined with occasional calls to the math library).</p>
<p>3) The best native compiler (Intel C++) is beating the best JITC (JVM 1.7) by around 50%.  That&#8217;s a sizable margin and more or less what I saw the last time I compared the two in late 2006.  My suspicion is that the Intel compiler is generation FP code that takes advantage of newer processor features (SSE2 vectors and whatnot) whereas the JIT is stuck using generic 80-bit x87 FP arithmetic.</p>
<p>4) IKVM is sort of an odd case.  It&#8217;s about 10% slower than C# on .NET.  But considering that it&#8217;s working with two levels of abstraction instead of 1, that&#8217;s actually surprisingly good.  In fact, it beats several of the older JVMs including 1.5.</p>
<p><strong>Code</strong></p>
<p><strong><a href="http://left404.com/wp-content/uploads/2011/12/pi_css5_src.tar.gz">pi_css5_src.tgz</a></strong> Source code for Java, C# and C++ versions of the program.</p>
<p><strong>Notes</strong></p>
<p>1) JDK 1.1 and 1.2 by default don&#8217;t allocate sufficient memory to run pi_css5 for 4 million digits.  To increase stack space, I used the -mx option.  -mx131000000 (i.e. 128MB) did the trick.</p>
<p>2) MSVC++ 10 compiler was invoked with the /O2 /Ot /Oy /GL optimization flags for the native code (optimize for speed, omit frame pointer, perform whole program optimizations).  For .NET, I used just /O2 (the others aren&#8217;t supported when targeting CLR).</p>
<p>3) Intel C++ 12 compiler was invoked with the /fast optimization flag.  I wish every compiler had a -fast flag.</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2011/12/01/bytecode-v-native/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mhz</title>
		<link>http://left404.com/2011/11/28/mhz/</link>
		<comments>http://left404.com/2011/11/28/mhz/#comments</comments>
		<pubDate>Mon, 28 Nov 2011 22:10:19 +0000</pubDate>
		<dc:creator>dara</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://left404.com/?p=920</guid>
		<description><![CDATA[While computers have changed a lot in the last 20 years, we still use clock speed (MHZ or GHZ) as the primary metric for describing speed.  Unfortunately, the manufacturers don&#8217;t make it easy.  First AMD and then Intel switched away from labeling their processors by clock.  Thus if you purchase a new machine today, the [...]]]></description>
			<content:encoded><![CDATA[<p>While computers have changed a lot in the last 20 years, we still use clock speed (MHZ or GHZ) as the primary metric for describing speed.  Unfortunately, the manufacturers don&#8217;t make it easy.  First AMD and then Intel switched away from labeling their processors by clock.  Thus if you purchase a new machine today, the processor is likely to be a &#8216;Core i3 2100&#8242; or a &#8216;Phenom X4 2200&#8242;.  The numbers that they use after the processor type aren&#8217;t the clock speed, rather, they&#8217;re some sort of internally-designated model number.</p>
<p><span id="more-920"></span></p>
<p>Of course even in the early days, processor speed correlated only loosely to actual performance.  Most computing tasks were limited by disk speed, memory speed or user input.  Moreover, processor architecture made and makes a major difference.  Intel&#8217;s &#8216;Prescott&#8217; Pentium 4 design reached 3.8GHZ almost 5 years ago, while most of today&#8217;s machines have a nominal clock speed of 2.5-3.0GHZ.  Yet even for simple tasks, today&#8217;s machine are considerably faster, as Intel and AMD have made their designs more efficient.</p>
<p>Multi-core processors are the current vogue.  Due to thermal constraints, the traditional doubling of processor clock speeds every 18 months is a thing of the past.  So manufacturers have taken the approach of bundling 2, 4 and now 6 &#8216;cores&#8217; on a single package.  The upside is that for tasks that can be parallelized, the performance gains are enormous (potentially 6x).  The downside is that many (most?) tasks don&#8217;t parallelize well, so a lot of that additional processing power is going to sit idle.</p>
<p>One other clever approach Intel and AMD have taken is dynamic clock-scaling.  For a long while, processors in laptop computers have had the ability to slow themselves down in order to maximize battery life, particularly when the processor isn&#8217;t very busy.  With various &#8216;boost&#8217; modes, today&#8217;s processors are doing the opposite &#8211; increasing the clock speed during periods of heavy load in order to increase performance.  They can get away with this by essentially disabling other cores which aren doing anything.</p>
<p>My Macbook Air for example has an Intel Core i5 that nominally is 2 cores running at 1.7GHZ.  In fact, much of the time it essentially just 1 core in operation, and consequently runs at 2.7GHZ.  Since most of my tasks run on only 1 processor, it&#8217;s a beneficial tradeoff.  Moreover, Intel has actually designed it so that for short periods, the processor will exceed its official speed rating even when both cores are active (until the temperature reaches a certain threshold).</p>
<p>The chart of clock speed vs. time is probably going to be even less meaningful in the future, but it is more than a little amazing to remember that my first machine, less than 20 years ago, ran at only 20MHZ.</p>
<p>In any case, if you&#8217;re interested in finding out the actual clock speed that the processor is running at, there&#8217;s a program in Larry McVoy&#8217;s <a href="http://www.bitmover.com/lmbench/"><strong>LMBench</strong></a> benchmark suite that can compute it (with the caveat that the program itself induces load, which can affect the clock).  The suite is fairly large and has a number of pieces, so I extracted the mhz program and disentangled the code from its dependencies..</p>
<p><strong><a href="http://left404.com/wp-content/uploads/2011/12/mhz.tar.gz">mhz.tar.gz</a></strong> - C source, Windows/Mac/Linux x86 binary.</p>
]]></content:encoded>
			<wfw:commentRss>http://left404.com/2011/11/28/mhz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

