[perf-test] Add a binding benchmark for div.setAttribute()
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2012 07:20:36 +0000 (07:20 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 18 May 2012 07:20:36 +0000 (07:20 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86815

Reviewed by Ryosuke Niwa.

We should remove Bindings/dom-attributes.html and instead add more
reasonable micro benchmarks by classifying DOM binding call paths.

This patch adds a benchmark for div.setAttribute(). This benchmark
covers 'setAttribute' in Dromaeo/dom-attr.html and other DOM methods
that return an undefined.

Test results in my Linux desktop:

RESULT Bindings: set-attribute= 793.745073252 runs/s
median= 791.589665765 runs/s, stdev= 6.00467159709 runs/s, min= 785.27607362 runs/s, max= 808.080808081 runs/s

RESULT Bindings: set-attribute= 790.858444164 runs/s
median= 787.918921436 runs/s, stdev= 7.86264953655 runs/s, min= 780.234070221 runs/s, max= 806.04534005 runs/s

RESULT Bindings: set-attribute= 787.277571417 runs/s
median= 784.31372549 runs/s, stdev= 7.45363346657 runs/s, min= 778.588807786 runs/s, max= 804.020100503 runs/s

RESULT Bindings: set-attribute= 782.401393791 runs/s
median= 779.062978802 runs/s, stdev= 6.48250081621 runs/s, min= 777.642770352 runs/s, max= 796.019900498 runs/s

RESULT Bindings: set-attribute= 791.792516608 runs/s
median= 791.556728232 runs/s, stdev= 6.49182980397 runs/s, min= 779.220779221 runs/s, max= 808.080808081 runs/s

* Bindings/set-attribute.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117553 268f45cc-cd09-0410-ab3c-d52691b4dbfc

PerformanceTests/Bindings/set-attribute.html [new file with mode: 0644]
PerformanceTests/ChangeLog

diff --git a/PerformanceTests/Bindings/set-attribute.html b/PerformanceTests/Bindings/set-attribute.html
new file mode 100644 (file)
index 0000000..7f40b5b
--- /dev/null
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<html>
+<body>
+<div id="foo"></div>
+<script src="../resources/runner.js"></script>
+<script>
+var div = document.getElementById("foo");
+
+PerfTestRunner.runPerSecond({
+    description: "This benchmark covers 'setAttribute' in Dromaeo/dom-attr.html and other DOM methods that return an undefined.",
+    run: function() {
+        var localDiv = div;
+        for (var i = 0; i < 10000; i++)
+            localDiv.setAttribute("id", "foo");
+}});
+</script>
+</body>
+</html>
index 74b6dc6..2f9f031 100644 (file)
@@ -1,3 +1,36 @@
+2012-05-18  Kentaro Hara  <haraken@chromium.org>
+
+        [perf-test] Add a binding benchmark for div.setAttribute()
+        https://bugs.webkit.org/show_bug.cgi?id=86815
+
+        Reviewed by Ryosuke Niwa.
+
+        We should remove Bindings/dom-attributes.html and instead add more
+        reasonable micro benchmarks by classifying DOM binding call paths.
+
+        This patch adds a benchmark for div.setAttribute(). This benchmark
+        covers 'setAttribute' in Dromaeo/dom-attr.html and other DOM methods
+        that return an undefined.
+
+        Test results in my Linux desktop:
+
+        RESULT Bindings: set-attribute= 793.745073252 runs/s
+        median= 791.589665765 runs/s, stdev= 6.00467159709 runs/s, min= 785.27607362 runs/s, max= 808.080808081 runs/s
+
+        RESULT Bindings: set-attribute= 790.858444164 runs/s
+        median= 787.918921436 runs/s, stdev= 7.86264953655 runs/s, min= 780.234070221 runs/s, max= 806.04534005 runs/s
+
+        RESULT Bindings: set-attribute= 787.277571417 runs/s
+        median= 784.31372549 runs/s, stdev= 7.45363346657 runs/s, min= 778.588807786 runs/s, max= 804.020100503 runs/s
+
+        RESULT Bindings: set-attribute= 782.401393791 runs/s
+        median= 779.062978802 runs/s, stdev= 6.48250081621 runs/s, min= 777.642770352 runs/s, max= 796.019900498 runs/s
+
+        RESULT Bindings: set-attribute= 791.792516608 runs/s
+        median= 791.556728232 runs/s, stdev= 6.49182980397 runs/s, min= 779.220779221 runs/s, max= 808.080808081 runs/s
+
+        * Bindings/set-attribute.html: Added.
+
 2012-05-17  Kentaro Hara  <haraken@chromium.org>
 
         [perf-test] Add a binding benchmark for div.getAttribute()