aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-04-05 14:08:26 +0200
committerRobin Burchell <robin.burchell@crimson.no>2017-04-06 12:00:45 +0000
commitdce842d522bde8decf91cdd6ece6fc639dc04389 (patch)
tree06d07c5d54b70f690fe37e4f4c6808f1651ac9af /benchmarks
parent3ee41ceb1eda284a1dae21f619640e0c0d965688 (diff)
Simple creation tests for a range of QtQuick types
The font-using ones are a bit of a pain in that we have to try to pick a font that will likely always be there, the rest are quite straightforward. View tests are not at all comprehensive, and may deserve a set of dedicated tests of their own (with actual delegates, and so on). Change-Id: I6485e4cf62a3644519910786c32d91a490b657b4 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/auto/creation/quick/delegates_flickable.qml15
-rw-r--r--benchmarks/auto/creation/quick/delegates_flipable.qml15
-rw-r--r--benchmarks/auto/creation/quick/delegates_focusscope.qml16
-rw-r--r--benchmarks/auto/creation/quick/delegates_fontloader.qml27
-rw-r--r--benchmarks/auto/creation/quick/delegates_fontmetrics.qml27
-rw-r--r--benchmarks/auto/creation/quick/delegates_gridview.qml16
-rw-r--r--benchmarks/auto/creation/quick/delegates_listview.qml17
-rw-r--r--benchmarks/auto/creation/quick/delegates_loader.qml23
-rw-r--r--benchmarks/auto/creation/quick/delegates_mousearea.qml17
-rw-r--r--benchmarks/auto/creation/quick/delegates_multipointtoucharea.qml17
-rw-r--r--benchmarks/auto/creation/quick/delegates_pathview.qml18
-rw-r--r--benchmarks/auto/creation/quick/delegates_pincharea.qml19
-rw-r--r--benchmarks/auto/creation/quick/delegates_rect_gradient.qml20
-rw-r--r--benchmarks/auto/creation/quick/delegates_shadereffect.qml18
-rw-r--r--benchmarks/auto/creation/quick/delegates_shadereffectsource.qml24
-rw-r--r--benchmarks/auto/creation/quick/delegates_textmetrics.qml29
16 files changed, 318 insertions, 0 deletions
diff --git a/benchmarks/auto/creation/quick/delegates_flickable.qml b/benchmarks/auto/creation/quick/delegates_flickable.qml
new file mode 100644
index 0000000..1a53f61
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_flickable.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Flickable with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Flickable {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
diff --git a/benchmarks/auto/creation/quick/delegates_flipable.qml b/benchmarks/auto/creation/quick/delegates_flipable.qml
new file mode 100644
index 0000000..77a05bb
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_flipable.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Flipable with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Flipable {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
diff --git a/benchmarks/auto/creation/quick/delegates_focusscope.qml b/benchmarks/auto/creation/quick/delegates_focusscope.qml
new file mode 100644
index 0000000..bcc2697
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_focusscope.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of FocusScope with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: FocusScope {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/benchmarks/auto/creation/quick/delegates_fontloader.qml b/benchmarks/auto/creation/quick/delegates_fontloader.qml
new file mode 100644
index 0000000..354552b
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_fontloader.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of FontLoader with some simple props
+// ### add a test for FontLoader from TTF?
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ property string fontName: {
+ if (Qt.platform.os == "osx") {
+ return "Helvetica"
+ } else if (Qt.platform.os == "linux") {
+ return "Open Sans"
+ } else if (Qt.platform.os == "windows") {
+ return "Arial"
+ }
+ }
+
+ delegate: Item {
+ FontLoader {
+ name: root.fontName
+ }
+ }
+}
+
diff --git a/benchmarks/auto/creation/quick/delegates_fontmetrics.qml b/benchmarks/auto/creation/quick/delegates_fontmetrics.qml
new file mode 100644
index 0000000..849dc0b
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_fontmetrics.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.4
+import QmlBench 1.0
+
+// Tests the creation of FontMetrics with some simple props
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ property string fontName: {
+ if (Qt.platform.os == "osx") {
+ return "Helvetica"
+ } else if (Qt.platform.os == "linux") {
+ return "Open Sans"
+ } else if (Qt.platform.os == "windows") {
+ return "Arial"
+ }
+ }
+
+ delegate: Item {
+ FontMetrics {
+ font.family: root.fontName
+ }
+ }
+}
+
+
diff --git a/benchmarks/auto/creation/quick/delegates_gridview.qml b/benchmarks/auto/creation/quick/delegates_gridview.qml
new file mode 100644
index 0000000..88dfac3
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_gridview.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of GridView with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: GridView {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/benchmarks/auto/creation/quick/delegates_listview.qml b/benchmarks/auto/creation/quick/delegates_listview.qml
new file mode 100644
index 0000000..ff930b5
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_listview.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of ListView with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: ListView {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
diff --git a/benchmarks/auto/creation/quick/delegates_loader.qml b/benchmarks/auto/creation/quick/delegates_loader.qml
new file mode 100644
index 0000000..52c4cd8
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_loader.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Loader with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Loader {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ sourceComponent: anItemComponent
+ }
+
+ Component {
+ id: anItemComponent
+ Item {
+ }
+ }
+}
+
diff --git a/benchmarks/auto/creation/quick/delegates_mousearea.qml b/benchmarks/auto/creation/quick/delegates_mousearea.qml
new file mode 100644
index 0000000..f63e687
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_mousearea.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of MouseArea with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: MouseArea {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ hoverEnabled: true
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/benchmarks/auto/creation/quick/delegates_multipointtoucharea.qml b/benchmarks/auto/creation/quick/delegates_multipointtoucharea.qml
new file mode 100644
index 0000000..dd5a2a4
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_multipointtoucharea.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of MultiPointTouchArea with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: MultiPointTouchArea {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
diff --git a/benchmarks/auto/creation/quick/delegates_pathview.qml b/benchmarks/auto/creation/quick/delegates_pathview.qml
new file mode 100644
index 0000000..42af201
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_pathview.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of PathView with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: PathView {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
+
diff --git a/benchmarks/auto/creation/quick/delegates_pincharea.qml b/benchmarks/auto/creation/quick/delegates_pincharea.qml
new file mode 100644
index 0000000..5dca674
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_pincharea.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of PinchArea with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: PinchArea {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
+
+
diff --git a/benchmarks/auto/creation/quick/delegates_rect_gradient.qml b/benchmarks/auto/creation/quick/delegates_rect_gradient.qml
new file mode 100644
index 0000000..faa4645
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_rect_gradient.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of rectangles with a gradient
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Rectangle {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#ff0000" }
+ GradientStop { position: 1.0; color: "#0000ff" }
+ }
+ }
+}
+
diff --git a/benchmarks/auto/creation/quick/delegates_shadereffect.qml b/benchmarks/auto/creation/quick/delegates_shadereffect.qml
new file mode 100644
index 0000000..58ea5cb
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_shadereffect.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of ShaderEffect
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: ShaderEffect {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ fragmentShader: "void main() { gl_FragColor = vec4(1, 0, 0, 1); }"
+ }
+}
+
+
diff --git a/benchmarks/auto/creation/quick/delegates_shadereffectsource.qml b/benchmarks/auto/creation/quick/delegates_shadereffectsource.qml
new file mode 100644
index 0000000..1974986
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_shadereffectsource.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of ShaderEffectSource with a few simple props.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 500
+ delegate: ShaderEffectSource {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ width: 30
+ height: 15
+ sourceItem: sourceRectItem
+ }
+
+ Rectangle {
+ id: sourceRectItem
+ color: "#ff0000"
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/benchmarks/auto/creation/quick/delegates_textmetrics.qml b/benchmarks/auto/creation/quick/delegates_textmetrics.qml
new file mode 100644
index 0000000..33a9506
--- /dev/null
+++ b/benchmarks/auto/creation/quick/delegates_textmetrics.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.4
+import QmlBench 1.0
+
+// Tests the creation of TextMetrics with some simple props
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ property string fontName: {
+ if (Qt.platform.os == "osx") {
+ return "Helvetica"
+ } else if (Qt.platform.os == "linux") {
+ return "Open Sans"
+ } else if (Qt.platform.os == "windows") {
+ return "Arial"
+ }
+ }
+
+ delegate: Item {
+ TextMetrics {
+ font.family: root.fontName
+ text: "Hello world"
+ }
+ }
+}
+
+
+