aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2019-05-03 21:00:19 +0200
committerRobin Burchell <robin.burchell@crimson.no>2019-05-06 08:19:47 +0000
commit55c0c1b9909fde5008015dee3cf8661a41a983ba (patch)
tree93fcbdb85dfb027e52ac6e1dc44d1018b15b2b63
parentaff2570b0281680d304614247ff283222484ee84 (diff)
Add a simple benchmark showing a regression in JS Date performance
Change-Id: I01be0574d6a09abe44336bcbe01ab6360396321f Task-number: QTBUG-75585 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
-rw-r--r--benchmarks/auto/js/date_getYear.qml13
1 files changed, 13 insertions, 0 deletions
diff --git a/benchmarks/auto/js/date_getYear.qml b/benchmarks/auto/js/date_getYear.qml
new file mode 100644
index 0000000..2e2639a
--- /dev/null
+++ b/benchmarks/auto/js/date_getYear.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the performance of getting the year out of a Date object
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1500;
+ property date dt: new Date()
+ delegate: Item {
+ property int year: root.dt.getYear()
+ }
+}