0 Replies Latest reply on Nov 4, 2009 12:45 AM by ahatest

    More weird&interesting&specific performance issue for RegExp!

    ahatest

      hi guys,

       

      *Questions*:
      1: Why so great difference between same specific RegExp and line?
      and why only in the second run, we have performance issue?
      I can see the only difference is the two RegExp are different instances.

       

      2: Any clue or hint to fix this issue?

       


      *Backgrounds*:
      The air program goes through big text files by multiple RegExps.
      a) The biggest text files is about 137K lines,
      b) In some long line(about 50 lines), there are about 1727 ascii chars, and even one line is about 8534 ascii chars.
      and air program has about 40 RegExps.
      c) Matching line with RegExp by
      "var mateched:Boolean = (regExps[index] as RegExp).test(line);"
      d) the specific RegExp is "(ERROR|FATAL|!ERROR_PRINTER_SETUP|!CA_ERRORCOUNT)".
      e) Windows Vista, Flex builder3, flex sdk3.2, actionscript3
      f) Any other information need?
      You may refer to my previous topic:
      "A weird performance issue" and "A weird performance issue about regExp!"

       

      *Step&Results*:
      First, new about 40 RegExp in air program, and processing each line of each text files.
      Result is:
      for these 1727 char line, each line cost about 2 milli second for the specific RegExp mentioned above.
      for 8534 char line, the line costs about 26 milli second for the specific RegExp.

       

      Then, re-new the same 40 Regexp in air program, and processing each line of each text files.
      But result is:
      for these 1727 char line, each line cost about 9-10 milli second for the specific RegExp.
      for 8534 char line, the line costs about 250 milli second for the specific RegExp.

       

      Then, do the same step again and again,
      but the result is like first result above, not like the second result any more.

       

      Thanks