Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Testing Perl 5.012002, Moose 1.24, Mouse 0.91, Moo 0.009007, Object::T +iny 1.08, Object::Tiny::XS 1.01 Benchmark: timing 6000000 iterations of Moo, Moo w/quote_sub, Moose, M +ouse, Object::Tiny, Object::Tiny::XS, hash, manual, manual with no ch +ecks... Object::Tiny::XS: 1 secs ( 1.20 usr + -0.01 sys = 1.19 CPU) @ 504201 +6.81/s hash, no check : 3 secs ( 1.86 usr + 0.01 sys = 1.87 CPU) @ 320855 +6.15/s Mouse : 3 secs ( 3.66 usr + 0.00 sys = 3.66 CPU) @ 163934 +4.26/s Object::Tiny : 3 secs ( 3.80 usr + 0.00 sys = 3.80 CPU) @ 157894 +7.37/s hash : 5 secs ( 5.53 usr + 0.01 sys = 5.54 CPU) @ 108303 +2.49/s manual, no check: 9 secs ( 9.11 usr + 0.02 sys = 9.13 CPU) @ 65717 +4.15/s Moo : 17 secs (17.37 usr + 0.03 sys = 17.40 CPU) @ 34482 +7.59/s manual : 17 secs (17.89 usr + 0.02 sys = 17.91 CPU) @ 33500 +8.38/s Mouse no XS : 20 secs (20.50 usr + 0.03 sys = 20.53 CPU) @ 29225 +5.24/s Moose : 21 secs (21.33 usr + 0.03 sys = 21.36 CPU) @ 28089 +8.88/s Moo w/quote_sub : 23 secs (23.07 usr + 0.04 sys = 23.11 CPU) @ 25962 +7.87/s

Mouse(::XS) is probably what you want: Source. Depending on how deep you want to go with Roles and Traits it’s nearly identical code-wise. This is your benchmark with a Mouse addition–

Rate moose mo mouse blessed_hashref + hashref moose 55157/s -- -22% -67% -86% + -88% mo 71023/s 29% -- -58% -82% + -85% mouse 168919/s 206% 138% -- -56% + -65% blessed_hashref 384615/s 597% 442% 128% -- + -20% hashref 478469/s 767% 574% 183% 24% + --

In reply to Re: The speed of blessed hashrefs, the power of Moose - how to get both? by Your Mother
in thread The speed of blessed hashrefs, the power of Moose - how to get both? by jdrago999

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 meditating upon the Monastery: (4)
As of 2024-03-28 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found