summaryrefslogtreecommitdiffstats
path: root/testing/talos/talos/tests/perf-reftest-singletons/window-named-property-get.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/talos/talos/tests/perf-reftest-singletons/window-named-property-get.html')
-rw-r--r--testing/talos/talos/tests/perf-reftest-singletons/window-named-property-get.html19
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/talos/talos/tests/perf-reftest-singletons/window-named-property-get.html b/testing/talos/talos/tests/perf-reftest-singletons/window-named-property-get.html
new file mode 100644
index 0000000000..7dfa802f7a
--- /dev/null
+++ b/testing/talos/talos/tests/perf-reftest-singletons/window-named-property-get.html
@@ -0,0 +1,19 @@
+<!doctype html>
+<script src="util.js"></script>
+<div id="x"></div>
+<script>
+ /*
+ * Test performance of bareword lookup via the Window's named properties
+ * object.
+ */
+ onload = function() {
+ let count = 1000000; // About 700ms
+ perf_start();
+ for (let i = count; i > 0; --i) {
+ // Pretty sure JITs are not smart enough to optimize out this proxy
+ // lookup, so no need to do anything other than perform the get.
+ x;
+ }
+ perf_finish();
+ }
+</script>