summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-01-19 14:57:55 (GMT)
committerJ-P Nurmi <jpnurmi@qt.io>2018-01-22 13:29:59 (GMT)
commit054b943e678728cf66e4c5c6d71a9650acb7432f (patch)
treeaf23daa3394ac0fd931f794495e5961cec444364
parent69f71318db48616d51c8f81715e794b483c1fbfa (diff)
downloadqtquickcontrols-054b943e678728cf66e4c5c6d71a9650acb7432f.tar.gz
Add creation benchmarks for qmlbench
The qmlbench repo has benchmarks only for a subset of QQC2. They are part of a larger collection of benchmarks that are run periodically, for which the results are collected to Grafana. We have limited resources there, so we don't want to overload it with benchmarks for many QQC1 types. However, for our own benchmarking purposes it is useful to be able to easily benchmark these types. Change-Id: I9124791a93f07346dc80f1f08aedd655ed0cfa02 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_busyindicator.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_button.qml15
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_checkbox.qml15
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_combobox.qml15
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_delaybutton.qml15
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_dial.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_groupbox.qml18
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_label.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_menu.qml22
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_progressbar.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_radiobutton.qml15
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_scrollview.qml19
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_slider.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_spinbox.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_stackview.qml18
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_switch.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_textarea.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_textfield.qml14
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_toolbutton.qml15
-rw-r--r--tests/benchmarks/qmlbench/creation/delegates_tumbler.qml16
20 files changed, 309 insertions, 0 deletions
diff --git a/tests/benchmarks/qmlbench/creation/delegates_busyindicator.qml b/tests/benchmarks/qmlbench/creation/delegates_busyindicator.qml
new file mode 100644
index 0000000..436b959
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_busyindicator.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: BusyIndicator {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ running: index % 2
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_button.qml b/tests/benchmarks/qmlbench/creation/delegates_button.qml
new file mode 100644
index 0000000..b12fe65
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_button.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: Button {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "Button"
+ __effectivePressed: index % 2
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_checkbox.qml b/tests/benchmarks/qmlbench/creation/delegates_checkbox.qml
new file mode 100644
index 0000000..be0d79c
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_checkbox.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: CheckBox {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "CheckBox"
+ checked: index % 2
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_combobox.qml b/tests/benchmarks/qmlbench/creation/delegates_combobox.qml
new file mode 100644
index 0000000..0cec266
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_combobox.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 250
+ delegate: ComboBox {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ model: 5
+ currentIndex: index % count
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_delaybutton.qml b/tests/benchmarks/qmlbench/creation/delegates_delaybutton.qml
new file mode 100644
index 0000000..2110a05
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_delaybutton.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Extras 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: DelayButton {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "DelayButton"
+ __effectivePressed: index % 2
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_dial.qml b/tests/benchmarks/qmlbench/creation/delegates_dial.qml
new file mode 100644
index 0000000..50c685f
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_dial.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Extras 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 500
+ delegate: Dial {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ value: index / root.staticCount
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_groupbox.qml b/tests/benchmarks/qmlbench/creation/delegates_groupbox.qml
new file mode 100644
index 0000000..3051404
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_groupbox.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: GroupBox {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ title: "GroupBox"
+ Item {
+ implicitWidth: 100
+ implicitHeight: 100
+ }
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_label.qml b/tests/benchmarks/qmlbench/creation/delegates_label.qml
new file mode 100644
index 0000000..70f9934
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_label.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: Label {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "Label"
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_menu.qml b/tests/benchmarks/qmlbench/creation/delegates_menu.qml
new file mode 100644
index 0000000..62878ce
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_menu.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 200
+ delegate: Item {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ width: menu.width
+ height: menu.height
+ Menu {
+ id: menu
+ visible: true
+ MenuItem { text: "MenuItem1" }
+ MenuItem { text: "MenuItem2" }
+ MenuItem { text: "MenuItem3" }
+ }
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_progressbar.qml b/tests/benchmarks/qmlbench/creation/delegates_progressbar.qml
new file mode 100644
index 0000000..64dbd5c
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_progressbar.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: ProgressBar {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ value: index / root.staticCount
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_radiobutton.qml b/tests/benchmarks/qmlbench/creation/delegates_radiobutton.qml
new file mode 100644
index 0000000..2a79754
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_radiobutton.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: RadioButton {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "RadioButton"
+ checked: index % 2
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_scrollview.qml b/tests/benchmarks/qmlbench/creation/delegates_scrollview.qml
new file mode 100644
index 0000000..57d5966
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_scrollview.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 250
+ delegate: ScrollView {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ width: 100
+ height: 100
+ Item {
+ implicitWidth: 200
+ implicitHeight: 200
+ }
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_slider.qml b/tests/benchmarks/qmlbench/creation/delegates_slider.qml
new file mode 100644
index 0000000..a036d26
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_slider.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: Slider {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ value: index / root.staticCount
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_spinbox.qml b/tests/benchmarks/qmlbench/creation/delegates_spinbox.qml
new file mode 100644
index 0000000..b5af86e
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_spinbox.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 250
+ delegate: SpinBox {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ value: index / root.staticCount * maximumValue
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_stackview.qml b/tests/benchmarks/qmlbench/creation/delegates_stackview.qml
new file mode 100644
index 0000000..7e55102
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_stackview.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 2000
+ delegate: StackView {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ width: 100
+ height: 100
+ initialItem: Item {
+ focus: StackView.status === StackView.Active
+ }
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_switch.qml b/tests/benchmarks/qmlbench/creation/delegates_switch.qml
new file mode 100644
index 0000000..88c8712
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_switch.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: Switch {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ checked: index % 2
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_textarea.qml b/tests/benchmarks/qmlbench/creation/delegates_textarea.qml
new file mode 100644
index 0000000..6801ffb
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_textarea.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 500
+ delegate: TextArea {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "Text\nArea"
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_textfield.qml b/tests/benchmarks/qmlbench/creation/delegates_textfield.qml
new file mode 100644
index 0000000..10b990a
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_textfield.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: TextField {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "TextField"
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_toolbutton.qml b/tests/benchmarks/qmlbench/creation/delegates_toolbutton.qml
new file mode 100644
index 0000000..075283b
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_toolbutton.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: ToolButton {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "ToolButton"
+ __effectivePressed: index % 2
+ }
+}
diff --git a/tests/benchmarks/qmlbench/creation/delegates_tumbler.qml b/tests/benchmarks/qmlbench/creation/delegates_tumbler.qml
new file mode 100644
index 0000000..8a41d42
--- /dev/null
+++ b/tests/benchmarks/qmlbench/creation/delegates_tumbler.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Extras 1.4
+
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 250
+ delegate: Tumbler {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ TumblerColumn {
+ model: 5
+ }
+ }
+}