aboutsummaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/qml/javascript/data/localId.qml
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/qml/javascript/data/localId.qml')
-rw-r--r--tests/benchmarks/qml/javascript/data/localId.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/benchmarks/qml/javascript/data/localId.qml b/tests/benchmarks/qml/javascript/data/localId.qml
new file mode 100644
index 0000000000..d42b891092
--- /dev/null
+++ b/tests/benchmarks/qml/javascript/data/localId.qml
@@ -0,0 +1,13 @@
+// Benchmarks the cost of accessing an id in the same file as the script.
+
+import QtQuick 2.0
+
+QtObject {
+ id: root
+
+ function runtest() {
+ for (var ii = 0; ii < 5000000; ++ii) {
+ root
+ }
+ }
+}