compiles your regex at compile time once and uses that precompiled piece of code in all your object-constructions, whereas useingmy $zip_re = qr/^$RE{zip}{US}{-extended => 'allow'}$/;
in your Moose-code will have to recompile your regex-code every-time again./^$RE{zip}{US}{-extended => 'allow'}$/
It doesn't explain why Perl on Mac OS X doesn't show as big a slowdown as Strawberry Perl.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
In reply to Re: Slowdown when using Moose::Util::TypeConstraints with Regexp::Common
by CountZero
in thread Slowdown when using Moose::Util::TypeConstraints with Regexp::Common
by kevbot
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |