aboutsummaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@crimson.no>2017-03-30 13:16:58 +0200
committerRobin Burchell <robin.burchell@crimson.no>2017-03-30 14:32:25 +0000
commit1d9d3df56ee972db58672780071620c7ac48420e (patch)
treed4868744d309446e9c0ea00bf04630e0631a7625 /benchmarks
parent75fdb0d04268d59dbd884c44bd7b7e67a11220cf (diff)
Layouts: Port to using benchmark helpers
Change-Id: Iabefd1817dd97485dad79f8cef4294fd4ca628c5 Reviewed-by: Gunnar Sletta <gunnar@crimson.no>
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/auto/creation/layouts/delegates_column.qml74
-rw-r--r--benchmarks/auto/creation/layouts/delegates_columnlayout.qml74
-rw-r--r--benchmarks/auto/creation/layouts/delegates_flow.qml74
-rw-r--r--benchmarks/auto/creation/layouts/delegates_grid.qml74
-rw-r--r--benchmarks/auto/creation/layouts/delegates_gridlayout.qml76
-rw-r--r--benchmarks/auto/creation/layouts/delegates_row.qml74
-rw-r--r--benchmarks/auto/creation/layouts/delegates_rowlayout.qml74
7 files changed, 218 insertions, 302 deletions
diff --git a/benchmarks/auto/creation/layouts/delegates_column.qml b/benchmarks/auto/creation/layouts/delegates_column.qml
index db1eee9..0f9349c 100644
--- a/benchmarks/auto/creation/layouts/delegates_column.qml
+++ b/benchmarks/auto/creation/layouts/delegates_column.qml
@@ -1,49 +1,37 @@
import QtQuick 2.0
+import QmlBench 1.0
-Item {
+CreationBenchmark {
id: root;
- property int count: 20;
- property int staticCount: 1000;
-
- property real t;
- NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
- onTChanged: {
- repeater.model = 0;
- repeater.model = root.count
- }
-
- Component.onCompleted: repeater.model = root.count
-
- Repeater {
- id: repeater
- Column {
- x: Math.random() * (root.width - width)
- y: Math.random() * (root.height - height)
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
+ count: 20;
+ staticCount: 1000;
+ delegate: Column {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
}
}
}
diff --git a/benchmarks/auto/creation/layouts/delegates_columnlayout.qml b/benchmarks/auto/creation/layouts/delegates_columnlayout.qml
index 166089f..5324b67 100644
--- a/benchmarks/auto/creation/layouts/delegates_columnlayout.qml
+++ b/benchmarks/auto/creation/layouts/delegates_columnlayout.qml
@@ -1,50 +1,38 @@
import QtQuick 2.0
+import QmlBench 1.0
import QtQuick.Layouts 1.0
-Item {
+CreationBenchmark {
id: root;
- property int count: 20;
- property int staticCount: 1000;
-
- property real t;
- NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
- onTChanged: {
- repeater.model = 0;
- repeater.model = root.count
- }
-
- Component.onCompleted: repeater.model = root.count
-
- Repeater {
- id: repeater
- ColumnLayout {
- x: Math.random() * (root.width - width)
- y: Math.random() * (root.height - height)
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
+ count: 20;
+ staticCount: 1000;
+ delegate: ColumnLayout {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
}
}
}
diff --git a/benchmarks/auto/creation/layouts/delegates_flow.qml b/benchmarks/auto/creation/layouts/delegates_flow.qml
index c38161c..db44caf 100644
--- a/benchmarks/auto/creation/layouts/delegates_flow.qml
+++ b/benchmarks/auto/creation/layouts/delegates_flow.qml
@@ -1,49 +1,37 @@
import QtQuick 2.0
+import QmlBench 1.0
-Item {
+CreationBenchmark {
id: root;
- property int count: 20;
- property int staticCount: 1000;
-
- property real t;
- NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
- onTChanged: {
- repeater.model = 0;
- repeater.model = root.count
- }
-
- Component.onCompleted: repeater.model = root.count
-
- Repeater {
- id: repeater
- Flow {
- x: Math.random() * (root.width - width)
- y: Math.random() * (root.height - height)
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
+ count: 20;
+ staticCount: 1000;
+ delegate: Flow {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
}
}
}
diff --git a/benchmarks/auto/creation/layouts/delegates_grid.qml b/benchmarks/auto/creation/layouts/delegates_grid.qml
index e30df75..3c10452 100644
--- a/benchmarks/auto/creation/layouts/delegates_grid.qml
+++ b/benchmarks/auto/creation/layouts/delegates_grid.qml
@@ -1,49 +1,37 @@
import QtQuick 2.0
+import QmlBench 1.0
-Item {
+CreationBenchmark {
id: root;
- property int count: 20;
- property int staticCount: 1000;
-
- property real t;
- NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
- onTChanged: {
- repeater.model = 0;
- repeater.model = root.count
- }
-
- Component.onCompleted: repeater.model = root.count
-
- Repeater {
- id: repeater
- Grid {
- x: Math.random() * (root.width - width)
- y: Math.random() * (root.height - height)
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
+ count: 20;
+ staticCount: 1000;
+ delegate: Grid {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
}
}
}
diff --git a/benchmarks/auto/creation/layouts/delegates_gridlayout.qml b/benchmarks/auto/creation/layouts/delegates_gridlayout.qml
index 2bf22b7..27d1498 100644
--- a/benchmarks/auto/creation/layouts/delegates_gridlayout.qml
+++ b/benchmarks/auto/creation/layouts/delegates_gridlayout.qml
@@ -1,51 +1,39 @@
import QtQuick 2.0
+import QmlBench 1.0
import QtQuick.Layouts 1.0
-Item {
+CreationBenchmark {
id: root;
- property int count: 20;
- property int staticCount: 1000;
-
- property real t;
- NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
- onTChanged: {
- repeater.model = 0;
- repeater.model = root.count
- }
-
- Component.onCompleted: repeater.model = root.count
-
- Repeater {
- id: repeater
- GridLayout {
- x: Math.random() * (root.width - width)
- y: Math.random() * (root.height - height)
- columns: 2
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
+ count: 20;
+ staticCount: 1000;
+ delegate: GridLayout {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ columns: 2
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
}
}
}
diff --git a/benchmarks/auto/creation/layouts/delegates_row.qml b/benchmarks/auto/creation/layouts/delegates_row.qml
index 1bcf1c2..9b74e2c 100644
--- a/benchmarks/auto/creation/layouts/delegates_row.qml
+++ b/benchmarks/auto/creation/layouts/delegates_row.qml
@@ -1,49 +1,37 @@
import QtQuick 2.0
+import QmlBench 1.0
-Item {
+CreationBenchmark {
id: root;
- property int count: 20;
- property int staticCount: 1000;
-
- property real t;
- NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
- onTChanged: {
- repeater.model = 0;
- repeater.model = root.count
- }
-
- Component.onCompleted: repeater.model = root.count
-
- Repeater {
- id: repeater
- Row {
- x: Math.random() * (root.width - width)
- y: Math.random() * (root.height - height)
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
+ count: 20;
+ staticCount: 1000;
+ delegate: Row {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
}
}
}
diff --git a/benchmarks/auto/creation/layouts/delegates_rowlayout.qml b/benchmarks/auto/creation/layouts/delegates_rowlayout.qml
index d4356b7..8f74a74 100644
--- a/benchmarks/auto/creation/layouts/delegates_rowlayout.qml
+++ b/benchmarks/auto/creation/layouts/delegates_rowlayout.qml
@@ -1,50 +1,38 @@
import QtQuick 2.0
+import QmlBench 1.0
import QtQuick.Layouts 1.0
-Item {
+CreationBenchmark {
id: root;
- property int count: 20;
- property int staticCount: 1000;
-
- property real t;
- NumberAnimation on t { from: 0; to: 1; duration: 1000; loops: Animation.Infinite }
- onTChanged: {
- repeater.model = 0;
- repeater.model = root.count
- }
-
- Component.onCompleted: repeater.model = root.count
-
- Repeater {
- id: repeater
- RowLayout {
- x: Math.random() * (root.width - width)
- y: Math.random() * (root.height - height)
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
- Rectangle {
- width: 50
- height: 10
- color: "red"
- }
+ count: 20;
+ staticCount: 1000;
+ delegate: RowLayout {
+ x: Math.random() * (root.width - width)
+ y: Math.random() * (root.height - height)
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
+ }
+ Rectangle {
+ width: 50
+ height: 10
+ color: "red"
}
}
}