in reply to Re^4: Play Template
in thread Play Template

Unannounced update. Pathetic, "performance doesn't matter" missive.

Now I must crush you.

Fail!

I'd guess, by looking at your command line invocation (c:\test>ROvCONST.pl), that you suffer under the burden of some flavor of Windows for which Readonly::XS is not available or is difficult to install.

Fail!

except that this imposes no performance penalty over a simple my() declaration:

Fail! Note that constant is actually faster than literals:

c:\test>ROvCONST.pl Rate Readonly literals const Readonly 4.06/s -- -44% -49% literals 7.21/s 78% -- -9% const 7.90/s 95% 10% --
In fact, I have slowly come to define most of my variables as scalars -- scalar hashrefs, scalar arrayrefs -- rather than hashes and arrays.

Fail!

Look up who said "Programs are more readable if different things look different.". And when. And why.

Or buy|rent a faster box, which might well be a cheaper solution than wasting my time.

Fail!

Take a look around you. In the early noughties, that attitude flew because clockspeeds increased from 400 MHz (1999) through to 3.3GHz in 2003. But it has stagnated for the last 7 years. Sure, they're managing to get through more instructions per clock, but only if the pipelines don't stall.

Throwing faster hardware at self-induced performance issues is no longer an option. Now, the options are threading, clustering, or map-reduce. All of which are far more complicated than simply avoiding, avoidable premature pessimisations

Let's discuss another aspect of the node.

Nothing else in the node was even vaguely of interest to me me. Nor anyone else it seems.

My play scripts generally exercise at most a dozen lines of code and exit almost before I touch Enter.

All that O'Woe(*) to try out a "dozen lines of code"?

(*)Order of Worshipful over-engineers.