[perf-test] Add a binding benchmark for div.getAttribute()
https://bugs.webkit.org/show_bug.cgi?id=86814
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.getAttribute(). This benchmark
covers 'getAttribute' in Dromaeo/dom-attr.html, and other DOM methods
that return a String.
Test results in my Linux desktop:
RESULT Bindings: get-attribute= 250.088158538 runs/s
median= 250.469728765 runs/s, stdev= 4.66551901315 runs/s, min= 240.673886883 runs/s, max= 256.739409499 runs/s
RESULT Bindings: get-attribute= 250.209764698 runs/s
median= 250.626959986 runs/s, stdev= 4.12030002477 runs/s, min= 241.254523522 runs/s, max= 255.102040816 runs/s
RESULT Bindings: get-attribute= 248.907532887 runs/s
median= 250.312891114 runs/s, stdev= 3.23173125874 runs/s, min= 240.673886883 runs/s, max= 251.572327044 runs/s
RESULT Bindings: get-attribute= 250.243680844 runs/s
median= 250.783797637 runs/s, stdev= 4.19327170024 runs/s, min= 240.963855422 runs/s, max= 255.102040816 runs/s
RESULT Bindings: get-attribute= 245.329046608 runs/s
median= 244.948040416 runs/s, stdev= 2.24314248534 runs/s, min= 240.384615385 runs/s, max= 248.756218905 runs/s
* Bindings/get-attribute.html: Added.
Canonical link: https://commits.webkit.org/104450@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-18 06:49:43 +00:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<body>
|
|
|
|
<div id="foo"></div>
|
|
|
|
<script src="../resources/runner.js"></script>
|
|
|
|
<script>
|
|
|
|
var div = document.getElementById("foo");
|
|
|
|
|
2012-10-17 22:06:52 +00:00
|
|
|
PerfTestRunner.measureRunsPerSecond({
|
[perf-test] Add a binding benchmark for div.getAttribute()
https://bugs.webkit.org/show_bug.cgi?id=86814
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.getAttribute(). This benchmark
covers 'getAttribute' in Dromaeo/dom-attr.html, and other DOM methods
that return a String.
Test results in my Linux desktop:
RESULT Bindings: get-attribute= 250.088158538 runs/s
median= 250.469728765 runs/s, stdev= 4.66551901315 runs/s, min= 240.673886883 runs/s, max= 256.739409499 runs/s
RESULT Bindings: get-attribute= 250.209764698 runs/s
median= 250.626959986 runs/s, stdev= 4.12030002477 runs/s, min= 241.254523522 runs/s, max= 255.102040816 runs/s
RESULT Bindings: get-attribute= 248.907532887 runs/s
median= 250.312891114 runs/s, stdev= 3.23173125874 runs/s, min= 240.673886883 runs/s, max= 251.572327044 runs/s
RESULT Bindings: get-attribute= 250.243680844 runs/s
median= 250.783797637 runs/s, stdev= 4.19327170024 runs/s, min= 240.963855422 runs/s, max= 255.102040816 runs/s
RESULT Bindings: get-attribute= 245.329046608 runs/s
median= 244.948040416 runs/s, stdev= 2.24314248534 runs/s, min= 240.384615385 runs/s, max= 248.756218905 runs/s
* Bindings/get-attribute.html: Added.
Canonical link: https://commits.webkit.org/104450@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@117550 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-05-18 06:49:43 +00:00
|
|
|
description: "This benchmark covers 'getAttribute' in Dromaeo/dom-attr.html, and other DOM methods that return a String.",
|
|
|
|
run: function() {
|
|
|
|
var localDiv = div;
|
|
|
|
for (var i = 0; i < 100000; i++)
|
|
|
|
localDiv.getAttribute("id");
|
|
|
|
}});
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|