Stories
Slash Boxes
Comments

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of nicholas (3034)

Wednesday July 01, 2009
04:19 AM

Full circle

A subroutine-threaded core stores each opcode as a separate C-level function. Each op in sequence is called and then the op returns back to the runcore. This is two branch instructions to dispatch each op, compared to only one for a direct-threaded core. However, recent benchmarks I have seen in Parrot show that the subroutine core actually performs faster then the direct-threaded core does. This is because modern microprocessors have lots of hardware dedicated to predicting and optimizing control flow in call/return situations, because that is one of the most common idioms in modern software. This is a nonintuitive situation where more machine code instructions actually execute faster then fewer instructions. Parrot's default "slow" core ("-R slow") and the so-called "fast" core ("-R fast") use this technique (actually, these cores aren't exactly "subroutine-threaded", but it's close). From the numbers I have seen, the fast core is the fastest in Parrot. Here's how it works, basically:

for (pc = program_start; pc < program_end; pc++) {
    functable[*pc](interp, args);
}

http://wknight8111.blogspot.com/2009/06/understanding-opcode-dispatch.html

Reminds me a lot of

while ((PL_op = CALL_FPTR(PL_op->op_ppaddr)(aTHX))) {
    PERL_ASYNC_CHECK();
}

http://perl5.git.perl.org/perl.git/blob/HEAD:/run.c#l40

What goes around, comes around. Although Whiteknight's blog gives a lot of useful detail on why it's come around again, and why it was different in the middle.

Tuesday June 23, 2009
03:53 AM

Dixonsvision

Here's a link to Dixonsvision. Because Dave told us to*.

* ish. He'd like the term to be more popular. Although it doesn't help that Dixons has been renamed to Currys.digital, presumably in an attempt to reset their wonderful reputation up to zero.

Thursday June 18, 2009
08:33 AM

Microcode

Dear lazyweb:

As I understand it, for a decade or more, x86 family CPUs haven't actually implemented the x86 instruction set in silicon, or at least not wholly in silicon. The underlying hardware is actually something far more RISC, and the CISC instruction set is converted to microcode which runs on the "real" CPU. I seem to remember reading* that some CPUs could even be flashed to upgrade the microcode.

So what I wondered was, how come one can't target the microcode direct? Cut out the middle man of the x86 abstraction layer. Either by breaking out of x86 into native, or even by restricting it to the reflashable CPUs, and upgrading to homebrew microcode that was basically a NOOP layer.

Whilst this isn't going to be a winner for a binary distributed OS, it would be viable for something that could be recompiled from source, such as GNU/Linux, *BSD or GNU/HURD. So what am I missing? Aside from this being quite hard work.

* citation needed fail.

Saturday June 13, 2009
12:30 PM

search engine clue

I asked how long is a renault scenic. Results varied:

Wolfram Alpha
Wolfram|Alpha isn't sure what to do with your input.
True Knowledge
Sorry, I don't know the answer to that question.
It sounds like this is something True Knowledge doesn't know about yet. Most of what True Knowledge knows has been taught to it by people like you.
Your question
What is the length of the object an unspecified member of Renault Scénic, a compact MPV produced by French automaker Renault, a first to be labelled as such in Europe?
Google
Renault Scénic — Length: 150.5 in (3,823 MM)
According to http://en.wikipedia.org/wiki/Renault_Scénic

So, I'm impressed by the True Knowledge's question parser. But Google came up with an answer. Ish. Two problems with it though - the Imperial is "correct", but isn't actually the value given on the Wikipedia page they cite (163in), and they have no clue when it comes to metric. Capitalisation matters. Clearly still an American company, rather than global.

Monday June 08, 2009
02:50 PM

UKIP need £2e6 - this won't be a problem for them, surely?

So, it seems that Nigel Farage has declared UKIP skint, and in need of 2 million quid. This would be the same Nigel Farage who was boasting about his £2 million "expenses". Well UKIP is also the party with MEPs convicted of fraudulent expenses*, and they've just increased their numbers - so likely this problem will find a solution soon? :-)

* yes, citation needed, I know.

04:30 AM

POSIX and xargs

Dear POSIX,

Why did you decide that xargs with no filename arguments should run the command once? I can only assume that there are zero mathematicians and zero computer scientists on the relevant committee. How else could such a demented special case get through?

Sunday June 07, 2009
01:00 PM

Standards - even more to choose from

So, wandering round Asda yesterday in the quest for cheap olives I discovered something I really didn't want to know. Not only are there lightbulbs with standard bayonet fittings, lightbulbs with small bayonet fittings, those with standard Edison screws and those with small Edison screws, it turns out that there's (at least) a fifth standard - 4 pins.

Waaaaah!

Meanwhile, I still can't find an energy saving bulb with oomph greater than "100W equivalent", nor can I find anything over "40 W equivalent" with an SES. In Vienna, domm had something >100"W", so they are made, but he'd said that he'd had to go hunting around to find it.

Meanwhile, the cheapest energy saving bulbs in Asda were at 4 for a pound. Is this a loss leader? Is someone subsidising it? Please can I have LED bulbs before we all get mercury posioning?

Saturday June 06, 2009
04:05 PM

David O'Leary talking bullshit

Mr O'Bastard has been getting lots of free press coverage about his plans to charge for the toilet on Ryanair. In particular, he's suggesting that it will allow him to cut toilet use, and thereby permit him to remove two toilets from his planes, add 6 more seats, and "cut fares"*.

Now, what no-one seems to be asking, and what I can't find online, are whether there are regulations for airline toilets, either for numbers, or accessibility. There does seem to be a FAA regulation for 1 cabin attendant per 50 passengers, but I can't spot anything for toilets, for either side of the Atlantic.

However, if I believe everything I read on the Internet, I believe I have evidence that he is at least talking bullshit on the 6 extra seats. spinne notes that you need to certify an aircraft for the number of passengers, and certification is an expensive business. As best I can find on the internet, the maximum in-use configuration of an 737-800 is 189, which is what Ryanair use. However, a bit of thinking about the necessarily fixed position of the overwing exit rows, and the seat pitch, suggests that on the current toilet configuration you can't get any more seats in without squeezing 16 rows in the place of 15, which probably isn't viable, suggesting that no airline could fly a 737-800 with 195 seats, so it's never been certified. That doesn't ground the idea. But this does:

Because the -900 retains the same exit configuration of the -800, seating capacity is limited to 177 seats in two classes, or 189 in a single-class layout.

An additional pair of exit doors and a flat rear pressure bulkhead increase seating capacity to 180 passengers in a 2-class configuration or 215 passengers in a single-class layout.

http://en.wikipedia.org/wiki/Boeing_737#737-900

So, unless Rynair is thinking about cutting some holes in the fuselage and installing extra exits, it looks like the huffing and puffing about extra rows of seats is merely hot air. Note that this doesn't stop them trying to charge for the toilets. However, instead of spending money talking to Boeing about custom toilet units with credit card readers [£5 minimum charge, anyone? Will they authorising online, or will it be under the "floor limit", so fraudulent cards will be their problem? :-)] as their spin suggests (and people fell for), they might adopt some existing practice as the Wikipedia article on airline lavatories(!) describes:

Recently, many regional airlines in North America have commenced the trend of eliminating the refilling of hand washing basin potable water tanks in order to reduce weight and reduce labor service costs, thus generating increased airline profits derived through added fuel savings due to reduction of aircraft weight and employee labor expenses[citation needed]. To facilitate sanitation, disinfectant hand-wipes are provided.

Lest I forget, I noticed something else on my travels. (No citation, sorry). Rynair is talking about buying more planes, and suggests that buying from Airbus is within the bounds of possibility - i.e. no, Boeing, do not assume that you can charge us lock-in prices. Airbus, somewhere else, were quoted as saying something to the effect of "no, we're not going to bother tendering to supply Ryanair, as they'll demand an excessive discount". Because you're worth it - not.

* We thank Big Bastard for raising the chocolate ration to 20g. I can't see the full article, but the FT reports that in 2007 rising airfares helped Ryanair, Europe's leading low cost airline, increase profits sharply in its third quarter and raise its profit forecasts for the full year. That's not the direction the airline would like you to think that the fares are headed.

Friday June 05, 2009
01:04 PM

Are Labour going to go the way of the SDP?

04:57 AM

Devel::NYTProf for the win.

So, with about 2 minutes investigation, Devel::NYTProf reveals that this will halve the time of my regression test for a work module:

use Memoize;
memoize 'Config::Any::plugins';

Sadly it won't work out for me whether that's the right thing to do, or whether there's a more correct fix to solve the real underlying problem.