On Tue, Oct 19, 2010 at 1:30 PM, Shlomi Fish <[email protected]> wrote:
> The results are: > 2. On the same machine, after converting the .pm file from MooseX-Declare to > Class-XSAccessor, it took the tests 2 seconds or so to run, about 14 times > faster (!). Furthermore, I still have some idea for some small optimisations. This is hardly surprising. Reporting this as somehow significant is not really being fair. Class::XSAccessor is an XS level Accessor Generator. MooseX::Declare is a parser-level sugar implementation on top of Moose. This is similar to comparing the startup costs of a Ariel Atom to a Rolls Royce. Sure they can both drive to the shop, but they have vastly different design goals in mind. Yes if you strip out 90% of the features, and replace the core with a simplified XS level implementation you will see a speed boost. Yes if you run this on an underpowered machine you'll see a more dramatic speed boost. A more fair comparison would have been to remove MooseX::Declare and replace it with Moose, or (and I haven't actually looked at the code yet) add in *all* of the used features from MooseX::Declare into the Class::XSAccessor version including any type checks, invocant aliasing, method parameters etc. -Chris
