
lichtjiang
New User
Aug 4, 2007, 2:08 PM
Post #2 of 2
(1067 views)
|
Re: [lichtjiang] Slow module problem?
[In reply to]
|
Can't Post
|
|
Solved finally. In the while loop (in "new" of "A.pm"), I used regular expression to look for certain patterns. Unfortunately, in "B.pm", "English" module is used and that was included long time ago for test purpose (yes, unfortunately, it is still there, BAD ) and I didn't notice it twice for this problem. Now, I check all modules used to locate where the problem is and realized that it caused this performance problem. This is a reminder to anyone who happens to use this module "English", from its documentation: PERFORMANCE ^ This module can provoke sizeable inefficiencies for regular expressions, due to unfortunate implementation details. If performance matters in your application and you don't need $PREMATCH, $MATCH, or $POSTMATCH, try doing use English qw( -no_match_vars ) ; . It is especially important to do this in modules to avoid penalizing all applications which use them.
|