Skip to content

Conversation

@autarch
Copy link
Member

@autarch autarch commented Dec 9, 2016

Before ths branch:

                         Rate HasCoercion()->coerce        to_HasCoercion
HasCoercion()->coerce  3477/s                    --                  -79%
to_HasCoercion        16779/s                  383%                    --

                               Rate MooseX::Types Type()->check MooseX::Types is_* plain Moose
MooseX::Types Type()->check  1214/s                          --               -87%        -95%
MooseX::Types is_*           9225/s                        660%                 --        -62%
plain Moose                 24390/s                       1909%               164%          --

And after:

                         Rate HasCoercion()->coerce        to_HasCoercion
HasCoercion()->coerce  3644/s                    --                  -84%
to_HasCoercion        22727/s                  524%                    --

                               Rate MooseX::Types Type()->check plain Moose MooseX::Types is_*
MooseX::Types Type()->check  1258/s                          --        -95%               -97%
plain Moose                 24631/s                       1857%          --               -39%
MooseX::Types is_*          40650/s                       3130%         65%                 --

I'm not sure why this was ever added, but all the tests pass if options is
just made an empty hash.
We're comparing plain Moose TCs to is_Foo and Foo()->check. The latter is
_incredibly_ slow because it goes through AUTOLOAD magic.

We're also comparing to_Foo() to Foo()->coerce.
@autarch autarch force-pushed the autarch/faster-take-3 branch from 63955a8 to 32e89aa Compare December 12, 2016 16:16
@karenetheridge
Copy link
Member

I squashed the revert-revert commit together with the one that used Sub::Defer, as these two combined show how simple the changes become with the use of Sub::Defer (and pushing any issues off into that module).

released in 0.49!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants