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

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]
[planetscape]: sleep well, Corion
[stonecolddevin]: erix seems pretty good, i listened to "So Many Roads" and it was nice. Not everyone's cup of tea but this guy can absolutely shred, he and the guy from Mastodon are definitely up there: https://www. v=VzhMkSN9dQc
[erix]: ha, good stuff - loud and fast...
[stonecolddevin]: here's some Mastodon for when you have 13 minutes to have your mind blown: https://www. v=4pvfQtUhtNE

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2017-06-22 21:47 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (531 votes). Check out past polls.