Are MooseX::Declare and MooseX::Method::Signatures production ready?

前端 未结 6 1617
谎友^
谎友^ 2021-02-05 18:04

From the current version (0.98) of the Moose::Manual::MooseX are the lines:

We have high hopes for the future of MooseX::Method::Signatures and MooseX

6条回答
  •  误落风尘
    2021-02-05 18:44

    MooseX::Method::Signatures (MXMS), and MooseX::Declare which uses it, is not production ready. This is not because the code isn't stable, but because it is appallingly slow. Simply using the method keyword, no types or arguments, is a 500-1000x runtime performance hit over a regular method call. My Macbook Pro can do about 6,000 simple method calls per second using MXMS vs 5,000,000 with plain Perl.

    Method::Signatures, in contrast, has almost no performance hit above what it would normally cost to do the requested checks. The syntax is almost exactly the same as MXMS and it supports Moose (and Mouse) types. Both rely on the same underlying syntax modifying technique. (Full disclosure, I am the author of Method::Signatures.)

    If you like MooseX::Declare but want the performance of Method::Signatures, try Method::Signatures::Modifiers.

提交回复
热议问题