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":



  • 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.