Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Of course, we should really throw in a truly "plain perl" example as well:

C:\test>type junk99.pl use Benchmark qw(cmpthese); { package Foo1; sub new { bless $_[1], $_[0] } sub foo { $_[0]{foo} } } { package Foo2; use Moo; has foo => (is => 'ro'); } { package Foo3; use Moose; has foo => (is => 'ro'); } our $foo1 = Foo1::->new({foo => 0}); our $foo2 = Foo2::->new({foo => 0}); our $foo3 = Foo3::->new({foo => 0}); our $foo4 = { foo => 0 }; cmpthese( -3, { OO_perl => q[ $foo1->foo for 1 .. 1000; ], moo => q[ $foo2->foo for 1 .. 1000; ], moose => q[ $foo3->foo for 1 .. 1000; ], plain_perl => q[ $foo4->{foo} for 1 .. 1000; ], }); C:\test>junk99 Rate moose moo OO_perl plain_perl moose 2004/s -- -3% -15% -74% moo 2068/s 3% -- -13% -73% OO_perl 2366/s 18% 14% -- -69% plain_perl 7624/s 280% 269% 222% --

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

RIP Neil Armstrong


In reply to Re^7: Unusual sorting requirements; comparing three implementations. by BrowserUk
in thread Unusual sorting requirements; comparing three implementations. by tobyink

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (2)
As of 2024-04-26 06:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found