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.
  • This looks like a good start, keep the fastyness improvements coming.

    Then maybe one day Moose::Tiny may actually be able to compete with Object::Tiny :)
    • Well, we will never beat you on memory usage, but I feel I must remind you that Moose::Tiny is 8% shorter to type than Object::Tiny ;)

      Also, we are really breathing down your neck with our accessors (from the Moose::Tiny POD):

        Benchmarking accessors...
                 Rate moose  tiny
          moose 485/s    --  -19%
          tiny  599/s   23%    --
      And reallly, the difference in speed here is simply because Moose::Tiny checks to make sure you don't try and use the read-only accessors to assign a value with, whereas Object::Tiny simply swallows the value silently without even a simple warn "RTFM!".

      On a more serious side, we have also been experimenting with a module we are calling MooseX::Compile. It does two things really, 1) it caches the generated meta-objects with Storable and only loads them if you ask for them and 2) writes out the accessors, constructors and destructors that we 'eval' in Moose into a .pm and/or .pmc file. The proof of concept prototype that we put together actually loaded as fast as our hand-coded-plain-old-vanilla-perl control file (something like 0.01s), and was actually pretty good in terms of memory usage (not on the scale of Object::Tiny of course, but hey, you can't win them all). This module will also offer (at least) two options for compilation, a first-time-compile penalty which writes out the PMC for you, or an install-time penalty which will allow you to deploy your module on CPAN in it's compiled form. And I saved the best for last too, since Moose is a meta-circular system, it should be possible to actually turn the MooseX::Compile goodness on Moose itself!

      So, as the saying goes, its not the size that matters but how you use it ;)

      - Stevan