Closed Bug 1208002 Opened 7 years ago Closed 7 years ago

Also optimize creation of RegExpMatch result for "str.match"

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox44 --- fixed

People

(Reporter: h4writer, Assigned: h4writer)

Details

Attachments

(1 file)

In bug 879402 this was done for regular regexp matching. But I forgot to do this for string matching.

n = 0;
s = ('hello, world;'); let r = 'hello';
for (var i=0; i<1000000; i++) {
    n+= s.match(r).length;
}

print(n)

Takes 800ms, while with this patch 200ms.
Attached patch PatchSplinter Review
Assignee: nobody → hv1989
Attachment #8665361 - Flags: review?(bhackett1024)
@arai: fyi, this will increase the old performance of "String.prototype.match(string)", without improving the performance of the selfhosted version. Your new code also removes this code, which isn't that bad. But I would like to make sure the selfhosted version is compared with the performance with this patch included. Still looking at potential improvements to get the selfhosted version at the same performance.
Attachment #8665361 - Flags: review?(bhackett1024) → review+
https://hg.mozilla.org/mozilla-central/rev/54e7351f2a6a
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.