Bug 79208

Summary: Add performance tests for DOM attribute getters and setters
Product: WebKit Reporter: Kentaro Hara <haraken>
Component: WebCore JavaScriptAssignee: Kentaro Hara <haraken>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, morrita, rniwa, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 79209, 79228, 79231, 79235    
Bug Blocks:    
Attachments:
Description Flags
Patch
none
Patch
none
patch for landing none

Description Kentaro Hara 2012-02-22 01:23:04 PST
I am planning to add performance tests for DOM attribute getters and setters in order to catch a performance regression in JavaScriptCore/V8 bindings, like bug 76492.

I would like to add the following two tests for each DOM attribute in HTMLElement.idl, Element.idl and Node.idl, which will most impact on the DOM performance in the real Web:

PerfTestRunner.run(function() {
    var div = document.createElement("div");
    for (i = 0; i < repeatTimesOfGetter; i++)
        div.id;
}

PerfTestRunner.run(function() {
    var div = document.createElement("div");
    for (i = 0; i < repeatTimesOfSetter; i++)
        div.id = "foo";
}

Actually, a setter traces a different call path depending on whether the assigned string is an empty, one character, or more than one characters. However, I guess that the test case worth adding would be just a string composed of more than one characters (e.g. "foo").
Comment 1 Kentaro Hara 2012-02-23 01:44:14 PST
Created attachment 128432 [details]
Patch
Comment 2 Kentaro Hara 2012-02-23 01:45:15 PST
If the patch is OK, I will roll out r108477.
Comment 3 Kentaro Hara 2012-02-23 01:48:38 PST
Created attachment 128433 [details]
Patch
Comment 4 Ryosuke Niwa 2012-02-23 16:05:11 PST
Comment on attachment 128433 [details]
Patch

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

> PerformanceTests/resources/runner.js:15
> +    this.log("Debug: " + text);

Please rename it to Info: instead since this is an extra information you provide.
Comment 5 Kentaro Hara 2012-02-23 16:18:45 PST
Created attachment 128590 [details]
patch for landing
Comment 6 WebKit Review Bot 2012-02-24 00:55:28 PST
The commit-queue encountered the following flaky tests while processing attachment 128590 [details]:

perf/object-keys.html bug 63769 (author: ojan@chromium.org)
The commit-queue is continuing to process your patch.
Comment 7 WebKit Review Bot 2012-02-24 00:55:41 PST
Comment on attachment 128590 [details]
patch for landing

Clearing flags on attachment: 128590

Committed r108748: <http://trac.webkit.org/changeset/108748>
Comment 8 Ryosuke Niwa 2012-02-24 14:14:49 PST
Ugh... this one too :( dom_attributes should be dom-attribute. I'm renaming that now.
Comment 9 Ryosuke Niwa 2012-02-24 14:16:09 PST
Renamed in http://trac.webkit.org/changeset/108846.