Slash Boxes
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Can you include in the benchmark? In most perl configurations it is somewhat faster than Class::Accessor::Fast.
    And it's also interesting which perl version on which OS the benchmark was running.
    • 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 and Class::MethodMaker as well. ( is not in the first benchmark because that tests object construction, mainly.)

  • You forgot the fastest of them all, Object::Tiny.

  • 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

    • 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?