in reply to Re^3: Slowdown when using Moose::Util::TypeConstraints with Regexp::Common
in thread Slowdown when using Moose::Util::TypeConstraints with Regexp::Common

Actually, using Regexp::Common w/o qr// should result in the regex being compiled the first time that it is used. Each time it is used after that, a string comparison should be used to see if the regex needs to be recompiled. So it should be only compiled once and only an extra string compare will be done each time it is run.

- tye        

  • Comment on Re^4: Slowdown when using Moose::Util::TypeConstraints with Regexp::Common (recompile)

Replies are listed 'Best First'.
Re^5: Slowdown when using Moose::Util::TypeConstraints with Regexp::Common (recompile)
by JavaFan (Canon) on Sep 23, 2008 at 12:20 UTC
    Yes, but the problem is creating said string. The $RE{...} expression dives down in a multi-level hash, which is tied on each level, and at the bottom, it calls a function.

    It may not be so slow as compiling a regexp, but it is the most likely cause of AddressA being the slowest of the four.