Almost anything that runs on a virtual machine — for example, Perl — will almost always be slower than something that runs on bare metal — for example, c — especially if the low-level code has been lovingly optimized and tuned, but under proviso that the author of the low-level code hadn't run out of tuits making the code both fast and correct.

If you have one hour to code something that uses associative arrays, chances are if you use Perl for the job you'll finish sooner and have fewer bugs than if you use c; plus the code might actually run faster (because perl's associative arratys have already been lovingly optimized and tuned for so many years). Of course, "one hour" and "something" are just arbitrary values; perhaps for you hashes in c is a trivial job (or maybe you're already familiar with an excellent c toolkit).

Keep in mind that you can Inline code from other languages (from c to Perl 6) in your Perl code, and thus make the hot spots much happier.


In reply to Re: High Performance Perl by gaal
in thread High Performance Perl by willyyam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.