Bug 16580 - StringProtoFuncReplace::callAsFunction should use vectors for a speedup
Summary: StringProtoFuncReplace::callAsFunction should use vectors for a speedup
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-23 00:59 PST by Eric Seidel (no email)
Modified: 2010-06-11 16:55 PDT (History)
1 user (show)

See Also:


Attachments
fix, sunspider is crazy (4.16 KB, patch)
2007-12-23 01:16 PST, Eric Seidel (no email)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2007-12-23 00:59:02 PST
StringProtoFuncReplace::callAsFunction should use vectors for a speedup

static JSValue *replace(ExecState *exec, StringImp* sourceVal, JSValue *pattern, JSValue *replacement)

Does all its array manipulation by hand.  It should use Vector<UString::Range> and Vector<UString> instead (if for no other reason than for the fast copies on expansion).

This is what one might call an "easy fix". :)
Comment 1 Eric Seidel (no email) 2007-12-23 00:59:36 PST
KJS::replace is 1.4% of the sample for:

run-sunspider --shark20 --tests "cube|tagcloud|unpack|spectra"
Comment 2 Eric Seidel (no email) 2007-12-23 01:16:55 PST
Created attachment 18070 [details]
fix, sunspider is crazy

I must have angered the sunspider gods again.  SS claims this is a regression on a bunch of unrelated tests.
Comment 3 Alexey Proskuryakov 2010-06-11 16:55:50 PDT
Looks like this function uses vectors now.