<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>204481</bug_id>
          
          <creation_ts>2019-11-21 16:40:25 -0800</creation_ts>
          <short_desc>Optimize String.prototype.replace() and replaceAll() for string searches.</short_desc>
          <delta_ts>2019-11-22 09:30:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>ASSIGNED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>204479</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Mark Lam">mark.lam</reporter>
          <assigned_to name="Mark Lam">mark.lam</assigned_to>
          <cc>ross.kirsling</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1592586</commentid>
    <comment_count>0</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2019-11-21 16:40:25 -0800</bug_when>
    <thetext>...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1592614</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Lam">mark.lam</who>
    <bug_when>2019-11-21 17:55:13 -0800</bug_when>
    <thetext>I created 3 microbenchmarks based on string-replace.js, string-replace-generic.js, and string-replace-empty.js, but use &quot;f&quot; as the searchValue instead of /f/g.  With these, I see that the patch in https://bugs.webkit.org/show_bug.cgi?id=202471 did indeed regressed performance:

                                               Old                       New
string-replace-generic-2                       30.0312+-1.2393     !     34.9829+-1.4384        ! definitely 1.1649x slower
string-replace-2                               29.4600+-1.1706     !     33.9296+-2.0799        ! definitely 1.1517x slower
string-replace-empty-2                         20.7875+-0.4358     !     24.9824+-1.1148        ! definitely 1.2018x slower</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>