Thursday, July 28, 2011

Strange but true...

I had assumed that running code in a guest OS rather than native would result in a fairly heavy performance penalty. This, then, was a pleasant surprise:

#
of cores
Native
/ Guest
Multi
processor directives

Execution
time (secs)
1 Guest Top
level loop

76.4
4 Guest Top
level loop
20.1
4 Native Top
level loop
19.8
4

Native

Matrix
multiplication subroutine
23.0


The same code runs only 1.5% slower in the guest than it does running native.

Also interesting: putting the multi-processing directives into particularly intensive sub-routines (like matrix multiplication) but not in the top level program does generate a substantial improvement, not that different from multi-processing at the top level with no MP in the subroutine. (Of course this assumes the program calls this
routine frequently...) My concern was that the overhead of flipping into and out-of the MP environment when MP subroutines are called frequently would negate its benefits - but at least in this case it appears not to be a problem.

So if I identify the routines that are called frequently and  are particularly intensive, I can improve performance in the subroutine libraries and not have to worry when coding the main routine. (Of course I probably should have written more efficient code to begin with, but that's another story).

Thursday, July 7, 2011

Just a thought - contingency legislation

We re repeatedly held hostage (metaphorically) by politicians who say that unless we do X, then Y (generally catastrophic) will occur. When it doesn't there is always a contingency-based excuse: "it would have happened had there been less Z".

We need a different approach, one that creates accountability ex-ante. So how about this... The example is in the context of the current deficit / budget negotiations.  The discussion is highly simplified and stylized (to use the economists phrase) for the purposes of illustration.

Republications assert that reducing government spending without raising tax rates or closing exemption loop holes will reduce uncertainty. This will spur firms to invest and create jobs in the US - which will increase tax receipts. So while spending falls, revenues rise and the budget will soon be balanced.  

Democrats argue that this probably won't happen; employers haven't shown any interested in creating (expensive) US based jobs when they can get the same work done abroad for pennies on the dollar.

Suppose one crafted legislation that said we'll do A which is predicted to lead to Y within time T. If by time T, Y hasn't happened, we'll do B. In this example, this might be: "We will cut spending and leave tax rates unchanged for 24 months. If by then unemployment hasn't risen, the conjecture that lower tax rates stimulate growth and job creation is shown to be invalid, at which point we will go to Plan B, namely closing tax loop holes and letting the Bush tax cuts expire".  The contingency, B, would require a 2/3 majority to repeal or nullify, so that only when a super-majority agrees that neither plan is working could the 'experiment' be undone.  

There are clearly a hundred and one reasons why this might not work, but I'm just a little tired of politicians making untested assertions about causal relations that are at best spurious, and often  based on claims of association or data that are completely false (such as the economy grows when tax rates are lowered, or that tax rates and the tax burden has never been higher when tax receipts as a percentage of GDP are at an all time low).

As I write this I can see how the two statements may be reconciled, but that is a testable hypothesis. And I've not heard anyone citing such a study...

Rhetorical conundrum

Yesterday I heard one politician (and this person was far from alone) complaining that Congress should pass the balanced budget amendment because government should work more like the private sector and live within it's means.

What a bizarre statement.

No company I know of has a provision in its articles of incorporation limiting the amount it can borrow to a proportion of its revenues. Indeed, were business to be forced into making such a provision there would be howls of "government interference". Business has the flexibility to borrow as much as the market see fit to lend it. When markets think a company is over extended, its paper is downgraded and its cost of borrowing rises.  Currently the same is true for states and nations.  A balanced budget amendment to the Constitutions makes government less like the private sector, not more.

What this really says about Washington, is that there is a realization that politicians can't trust themselves (let alone each other). This is not unpredictable, since they seldom have 'skin in the game' in the long term, and those that do are adept at avoiding and diverting accountability.

If nations were to be treated like business they would be left to go bankrupt were there to come a point at which they could no longer service their debt. Market discipline would then prevent those profligate spenders from raising any additional debt and they would be forced to live within their means. (Some economists have suggested that Greece should do exactly this rather than suffer through more IMF imposed bailout conditions).

The reason, which Washington seems to understand, that this won't work is that those who rack up the spending often aren't around to answer for the consequences (any more that those who pushed for the deregulation of the finance industry were required to answer for the 2008 meltdown).

Friday, July 1, 2011

Plus ca change

OS/2 Warp 4 now seems to install without too much drama under VMware Player 3.1.1 and VMWare Fusion. So now I have OS/2 on my Mac. But that's another story. Here's my first app: Word 5.5 which I think was released in 1993. 
 And this  is Word from Office 2003: strikingly similar... 

Apparently, Word 5.5 was re-jigged to match the Word for Windows 3.11 layout. And that's a good thing, I think. I know where stuff is (and by the same token is one reason I'm not going to move to Office 2007).