Bug 26957 - RegExp::match to be optimized
Summary: RegExp::match to be optimized
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: http://code.staikos.net/cgi-bin/gitwe...
Keywords:
: 26368 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-07-03 13:35 PDT by Yong Li
Modified: 2011-06-10 13:01 PDT (History)
4 users (show)

See Also:


Attachments
the patch (10.01 KB, patch)
2009-07-03 13:35 PDT, Yong Li
mjs: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yong Li 2009-07-03 13:35:00 PDT
Created attachment 32246 [details]
the patch

RegExp::match() should use inline Vector rather than OwnArrayPtr for better performance.

The patch is attached.

It gives more than 20% boost to sunspider string-unpack-code test, and gives about 8% boost to sunspider overall result.
Comment 1 George Staikos 2009-07-03 13:40:02 PDT
Note: the performance test was done on ARM with bytecode (no JIT), no FPU.
Comment 2 Gavin Sherlock 2009-07-03 14:32:52 PDT
Possibly a dupe of Bug 26316
Comment 3 Maciej Stachowiak 2009-07-03 18:17:45 PDT
Comment on attachment 32246 [details]
the patch

Thanks for the patch! Looks like a good fix. On Mac OS X, this gives a 5% speedup on string-unpack code and smaller speedups on the other string tests, for an overall benefit of around 0.3% to SunSpider overall (some tests seem to slow down a bit but this appears to be noise). This patch doesn't handle the YARR case, I went ahead and filled that in and will post the revised patch in addition to commiting it. Also this patch was missing a ChangeLog.
Comment 4 Yong Li 2009-07-03 19:15:21 PDT
Thanks, Maciej. Should I create a changelog by myself?

The reason why we get more speedup is probably that our memory allocation is much slower than Mac OS.
Comment 5 Maciej Stachowiak 2009-07-04 07:23:21 PDT
For future patches, please include a ChangeLog entry (the prepare-ChangeLog script can fill in a lot of it for you). For this patch, I wrote a ChangeLog entry for you and checked it in (along with a few code changes to work with YARR) as <http://trac.webkit.org/changeset/45545>.

If the allocator on your platform is that slow, you may want to look into whether it's possible to use FastMalloc.
Comment 6 Yong Li 2009-07-04 09:00:28 PDT
(In reply to comment #5)
> For future patches, please include a ChangeLog entry (the prepare-ChangeLog
> script can fill in a lot of it for you). For this patch, I wrote a ChangeLog
> entry for you and checked it in (along with a few code changes to work with
> YARR) as <http://trac.webkit.org/changeset/45545>.
> If the allocator on your platform is that slow, you may want to look into
> whether it's possible to use FastMalloc.

Thanks a lot. prepare-ChangeLog never works for me (in GIT BASH). I have to do it manually.
Comment 7 Gavin Barraclough 2011-06-10 13:01:27 PDT
*** Bug 26368 has been marked as a duplicate of this bug. ***