NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
accessors.pm (Score:1)
And it's also interesting which perl version on which OS the benchmark was running.
Re: (Score:1)
Thanks for the feedback!
I wrote the config in the first benchmark post, but maybe it was easy to miss as it is between the program and the results: 2.16 GHz MacBook with 2 GB RAM, Mac OS X 10.5.5, perl 5.8.8 (not the most recent one, I know).
After an update, the results now include accessors.pm and Class::MethodMaker as well. (accessors.pm is not in the first benchmark because that tests object construction, mainly.)
I cry shenanigans! (Score:1)
You forgot the fastest of them all, Object::Tiny.
Re: (Score:1)
Re: (Score:1)
I realised one more you forgot (Score:1)
It seems to me to be slightly odd that Object::Tiny is faster than Class::Accessor::Fast::XS, since the latter is a blatant copy/paste job from Class::XSAccessor, which I _KNOW_ is faster than Object::Tiny.
So between Stephen and I we propose a new "King" for your competition, which we can tentatively call "Object::Tiny::XS" and is Object::Tiny enhanced by Class::XSAccessor.
use Object::Tiny qw/myattr/;
use Class::XSAccessor getters => { myattr => 'myattr' };
That should combine the fastest part of Object
Re: (Score:1)
I've added it and others and repackaged the whole thing - see this blog entry [hanekomu.at]
Badger? (Score:1)
How about Badger?
http://search.cpan.org/perldoc?Badger [cpan.org]
Re: (Score:1)
I'd like to add benchmarks for Badger but am not sure which of the many options to use. Use Badger::Class? accessors() or mutators()? Where do I get new() from? Foo->new(myattr => 27) seems to set $obj->{conf}{myattr}, but $obj->myattr() seems to want to read from $obj->{myattr}. Badger seems to have a lot of features, and maybe I'm too dense to pick out a simple example...
Could you please show me a simple example along the lines of the existing benchmarks how I should benchmark Badger?