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.
Keep it going :) (Score:1)
Then maybe one day Moose::Tiny may actually be able to compete with Object::Tiny
Re:Keep it going :) (Score:1)
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):
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 simplewarn "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
Reply to This
Parent