Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

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

by BrowserUk (Patriarch)
on Mar 31, 2014 at 13:44 UTC ( [id://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.

Replies are listed 'Best First'.
Re^4: Perl object memory overhead (Benchmark special case?)
by tobyink (Canon) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1080396]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-29 01:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found