Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Perl object memory overhead (Benchmark special case?)

by BrowserUk (Pope)
on Mar 31, 2014 at 13:44 UTC ( #1080396=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Perl object memory overhead
in thread Perl object memory overhead

Ooh! Do I spy a benchmark special case like the ones that compiler makers used to add to get good scores? :)

isa => 'Int', traits => ['Counter'], handles => { adjust_a => 'inc' },

What if you changed the increment to +33?

Also, it would be really useful to see the timing of adjust_a() run on the 3e6 objects, along with memory consumption?


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.


Comment on Re^3: Perl object memory overhead (Benchmark special case?)
Download Code
Re^4: Perl object memory overhead (Benchmark special case?)
by tobyink (Abbot) on Mar 31, 2014 at 16:54 UTC

    There's this:

    handles => { adjust_a => [ 'inc', 33 ] },

    It's not as fast because the arrayref in handles results in a curried coderef, but not unacceptably slow either.

    use Moops; class Cow :rw { has name => (default => 'Ermintrude') }; say Cow->new->name

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1080396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2014-08-29 17:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (283 votes), past polls