Comment #2 on issue 831 by polarjs: regexp performance seems to degrade exponentially with length of failed expression
http://code.google.com/p/v8/issues/detail?id=831

I see that if I change emailRegEx in the above test to a more reasonable / optimal form:

  var emailRegEx = /^[a-z0-9]+[a-z0-9._%+...@[a-z0-9.-]+\.[a-z]{2,4}$/;

The time take will always be 2 ms no matter where it passes or fails the match. I guess it makes sense that the () sub expression will cause recursion that will slow things down. But is it reasonable that it slows things down exponentially with each additional character?

Thanks.


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to