<html>
<head>
<base href="https://bugs.webkit.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - RegExp with anchor negation and grouping performance"
href="https://bugs.webkit.org/show_bug.cgi?id=152578">152578</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>RegExp with anchor negation and grouping performance
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>Product</th>
<td>WebKit
</td>
</tr>
<tr>
<th>Version</th>
<td>Safari 9
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>Mac OS X 10.10
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>Normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P2
</td>
</tr>
<tr>
<th>Component</th>
<td>JavaScriptCore
</td>
</tr>
<tr>
<th>Assignee</th>
<td>webkit-unassigned@lists.webkit.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>shahar.soel@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>reproduced here:
<a href="https://jsperf.com/regexp-negation-in-group/5">https://jsperf.com/regexp-negation-in-group/5</a>
Expected:
* Similar performance for these two regExps
* Performance for these RegExp.test should be independent of input size as they anchor to the start of the input.
var noGroup = /^"[^\\"]+"/;
var oneGroup = /^"(:?[^\\"])+"/;
Actual:
* for oneGroup regExp the performance is much worse.
anywhere from x30 slower for a single line input
to 5 orders of magnitude for a 10000 lines input.
When running the benchmark on other browsers (chrome/firefox)
The input size does not affect the performance.
Thanks.
Shahar.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>