Interesting. But they are quite wrong (see above).

Actually, you're quite wrong. And if you learnt to use strict you'd have seen your mistake.

Here are the results of your benchmark once your mistake is corrected.

[18:46:32.42] P:\test>junk Rate Ref_Named Named Ref_Copy Shift POE + Normal Ref_Named 119185/s -- -3% -35% -81% -83% + -84% Named 122333/s 3% -- -34% -81% -83% + -84% Ref_Copy 183991/s 54% 50% -- -71% -74% + -76% Shift 639848/s 437% 423% 248% -- -9% + -17% POE 701269/s 488% 473% 281% 10% -- + -9% Normal 768699/s 545% 528% 318% 20% 10% + --
And that should absolutely zero surprise to anyone: OBJECT, KERNEL, HEAP, and SESSION are all subs which would mean subroutine calls.

You're the one in for the surprise. They aren't subroutine calls, they are constant subroutine calls. What difference does that make?

It means that at compile time, Perl can detect that they are constant subroutines.

[18:43:58.10] P:\test>perl -MO=Deparse -e"use constant{ONE=>1,TWO=>2}; + for( ONE .. TWO) { print }" use constant ({'ONE', 1, 'TWO', 2}); foreach $_ (1 .. 2) { print $_; } -e syntax OK

Did you spot your error yet? use strict would have told you way back up ^ there somewhere--but I guess that is another "artificial box" you'd rather stay out of.

So, what do you think we should put a pox on now? Flying by the seat of your pants! :)


Examine what is said, not who speaks.
Silence betokens consent.
Love the truth but pardon error.

In reply to Re^6: POE OO sessions - accessing overwritten methods by BrowserUk
in thread POE OO sessions - accessing overwritten methods by m-rau

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.