I would not advocate this use for anything other than those applications that require the performance or memory gains or both.

Example: Data::Trie & Tree::Trie. Both of these modules use hash-based instantiations. The problem is that they require so much room for each node in the trie that they are next to useless for any practical purpose.

It's a simple case of using Perl to it's best advantage to achieve the desired goal. Blanket statements that all Perl OO modules should be hash-based completely ignores the possibilities of 3 or more other ways Perl's flexibility can be used to good affect to avoid having to drop into the nightmare of XS programming or the deep dependancies of Inline::C.

Perl6 will provide the Perl programmer with a much greater degree of control over the storage representation of data elements and aggregates and it will (hopefully) impose far less penalties for using OO dispatching. Till then, if your application needs to deal with large volumes of concurrent, in-memory instances, or you want to extract the best performance from a given class, using the flexibility that Perl's OO mechanism provides to achieve your requirements is simple practical.

Noone's advocating that every Perl class should be re-written to use an array-based representation to gain the 20%/40% benefits they can provide. If you don't need to optimise don't. If throwing hardware at the problem is an option; do so. It's just another option available to those that want or need it that can be safetly (and quietly) ignored by those that either don't need it or choose not to use for whatever reasons.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

In reply to Re^6: Which, if any, is faster? (20% faster/ 40% smaller) by BrowserUk
in thread Which, if any, is faster? by rvosa

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.