Of course, Perl sacrifices a lot of performance to the reference counting

I've seen this claim made by the people who refused to reimplement reference counting in Parrot. But the only reference I saw from them that they claimed supported this only said something more like garbage collection really isn't too much terribly slower than reference counting, as far as they noticed.

Just because you've heard something repeated many times, doesn't mean that there necessarily is any evidence to support it.

Incrementing and decrementing are two of the fastest things computers know how to do. Adding an increment to a call to malloc() is "in the noise" performance-wise. Certainly for Perl 5, the cost of reference counting to performance is insignificant. And I won't believe that ref counting has much of a performance cost even in a highly-efficient system, until I see some real evidence. Removing an increment assembly op is certainly micro-optimization and it is extremely hard to get micro-optimizations to have much impact on the performance of real code. Your code would have to be doing a ton of taking and removing references and little other real work for the inc/dec to add up to even a non-trivial fraction of the run-time.

- tye        


In reply to Re^5: Parrot, threads & fears for the future. (ref counting) by tye
in thread Parrot, threads & fears for the future. by BrowserUk

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.