Um, I hate to break it to you, but perl is fully interpreted with
no just-in-time compilation.
Every operation and
every argument passed to it in a script is dozens of branches, no matter how innocent. The way to optimize a perl program is to code it with the fewest possible operations, fewest function calls, fewest assignments to a temporary variable, and even fewest curly-brace
scopes. Optimizing a perl program is generally the opposite of making it more readable. (but there is a time and a place, etc)
For a little mind-bender, try this:
perl -MBenchmark -E '
my $x= 1;
timethese(50000000, {
mul => q{$x*$x},
sqrt => q{sqrt($x)}
})'
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.