aboutsummaryrefslogtreecommitdiffstats
path: root/tests/html/bindings_perf.html
diff options
context:
space:
mode:
Diffstat (limited to 'tests/html/bindings_perf.html')
-rw-r--r--tests/html/bindings_perf.html12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/html/bindings_perf.html b/tests/html/bindings_perf.html
index d50cf940c32..123c53d6c00 100644
--- a/tests/html/bindings_perf.html
+++ b/tests/html/bindings_perf.html
@@ -1,6 +1,7 @@
<button onclick="void_method()">measure void method</button>
<button onclick="int_getter()">measure int getter</button>
<button onclick="firstChild_getter()">measure firstChild getter</button>
+<button onclick="proxy_firstChild_getter()">measure proxy firstChild getter</button>
<script>
var t = 'TestBinding' in window ? (new TestBinding()) : (new TextEncoder());
function void_method() {
@@ -33,4 +34,15 @@ function firstChild_getter() {
var stop = new Date();
console.log('firstChild getter: ' + ((stop - start) / count * 1e6) + 'ns');
}
+
+function proxy_firstChild_getter() {
+ var n = document;
+ var start = new Date();
+ var count = 1000000;
+ for (var i = 0; i < count; i++) {
+ var a = n.firstChild;
+ }
+ var stop = new Date();
+ console.log('proxy firstChild getter: ' + ((stop - start) / count * 1e6) + 'ns');
+}
</script>