Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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.

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1080396]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2018-06-24 23:29 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (126 votes). Check out past polls.