0 Replies Latest reply on Nov 3, 2009 3:46 AM by ahatest

    A weird performance issue about regExp!

    ahatest

      The further clue about the previous topic: "A weird performance issue"
      After some investigation, maybe regExp is one of the reasons.

       

      One loop in my air program:

       

          var beg1:Date = new Date();
          regexMatched = regexpArray[index].test(line);
          var end1:Date = new Date();
          sum1 += (end1.valueOf()-beg1.valueOf());

       

      Then some samples for value of sum1:
      The 1st run--------The 2nd run--------The 3rd run
      34   --->          154      --->      34               
      39   --->          141      --->      39
      54   --->          200      --->      59

       

      Why so great difference for the second run regExp.test()?

      In actionscript3, any specail implement for regExp?

       

       

      Any comments?

       

      Thanks.