Bug 80506 - [V8][Performance] Optimize Element.firstElementChild, Element.lastElementChild, Element.previousElementSibling, Element.nextElementSibling, Node.parentElement
Summary: [V8][Performance] Optimize Element.firstElementChild, Element.lastElementChil...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kentaro Hara
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-07 04:00 PST by Kentaro Hara
Modified: 2012-03-07 14:37 PST (History)
7 users (show)

See Also:


Attachments
Performance tests (1.74 KB, text/html)
2012-03-07 04:01 PST, Kentaro Hara
no flags Details
Patch (9.88 KB, patch)
2012-03-07 04:05 PST, Kentaro Hara
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kentaro Hara 2012-03-07 04:00:59 PST
Element.firstElementChild, Element.lastElementChild, Element.previousElementSibling, Element.nextElementSibling and Node.parentElement of V8 are much slower than JSC. We should optimize them.

The results of the attached performance tests are as follows in my local Mac environment :

AppleWebKit/Safari:
div.firstElementChild : 1162ms
div.lastElementChild : 1016ms
div.previousElementSibling : 918ms
div.nextElementSibling : 900ms
div.parentElement : 901ms

Chromium/V8:
div.firstElementChild : 9515ms
div.lastElementChild : 9449ms
div.previousElementSibling : 9254ms
div.nextElementSibling : 9315ms
div.parentElement : 9380ms
Comment 1 Kentaro Hara 2012-03-07 04:01:38 PST
Created attachment 130594 [details]
Performance tests
Comment 2 Kentaro Hara 2012-03-07 04:05:14 PST
Created attachment 130595 [details]
Patch
Comment 3 Adam Barth 2012-03-07 10:09:56 PST
Comment on attachment 130595 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=130595&action=review

> Source/WebCore/ChangeLog:11
> +        This patch improves the performance of Element.firstElementChild by 5.8 times,
> +        Element.lastElementChild by 6.2 times, Element.previousElementSibling by 7.1 times,
> +        Element.nextElementSibling by 7.1 times, and Node.parentElement by 6.7 times.

Wow
Comment 4 WebKit Review Bot 2012-03-07 14:37:17 PST
Comment on attachment 130595 [details]
Patch

Clearing flags on attachment: 130595

Committed r110106: <http://trac.webkit.org/changeset/110106>
Comment 5 WebKit Review Bot 2012-03-07 14:37:22 PST
All reviewed patches have been landed.  Closing bug.