aboutsummaryrefslogtreecommitdiffstats
path: root/src/benchmarks/auto
diff options
context:
space:
mode:
Diffstat (limited to 'src/benchmarks/auto')
-rw-r--r--src/benchmarks/auto/animations/comparison/README.md17
-rw-r--r--src/benchmarks/auto/animations/comparison/moving-images-animations.qml28
-rw-r--r--src/benchmarks/auto/animations/comparison/moving-images-animators.qml28
-rw-r--r--src/benchmarks/auto/animations/comparison/moving-images-script.qml30
-rw-r--r--src/benchmarks/auto/animations/comparison/moving-images-simple.qml29
-rw-r--r--src/benchmarks/auto/bindings/compositesingleton.qml15
-rw-r--r--src/benchmarks/auto/canvas/canvas_text_simple.qml29
-rw-r--r--src/benchmarks/auto/changes/README.md5
-rw-r--r--src/benchmarks/auto/changes/changing_over_isolated.qml50
-rw-r--r--src/benchmarks/auto/changes/changing_over_isolated_with_clip.qml49
-rw-r--r--src/benchmarks/auto/changes/changing_over_isolated_with_clip_rotated.qml57
-rw-r--r--src/benchmarks/auto/changes/changing_text_oneofmany.qml22
-rw-r--r--src/benchmarks/auto/changes/changing_texts.qml22
-rw-r--r--src/benchmarks/auto/creation/README.md14
-rw-r--r--src/benchmarks/auto/creation/layouts/delegates_column.qml38
-rw-r--r--src/benchmarks/auto/creation/layouts/delegates_columnlayout.qml39
-rw-r--r--src/benchmarks/auto/creation/layouts/delegates_flow.qml38
-rw-r--r--src/benchmarks/auto/creation/layouts/delegates_grid.qml38
-rw-r--r--src/benchmarks/auto/creation/layouts/delegates_gridlayout.qml40
-rw-r--r--src/benchmarks/auto/creation/layouts/delegates_row.qml38
-rw-r--r--src/benchmarks/auto/creation/layouts/delegates_rowlayout.qml39
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_bool.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_double.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_int.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_real.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_string.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_url.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_array.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_bool.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_int.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_object.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_string.qml13
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_array.qml14
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_bool.qml14
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_int.qml14
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_object.qml14
-rw-r--r--src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_string.qml14
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bool.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bytearray.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_color.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_datetime.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_int.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_jsvalue.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_point.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_real.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_rect.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_size.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_string.qml24
-rw-r--r--src/benchmarks/auto/creation/qml.modelaccess/modelaccess_url.qml24
-rw-r--r--src/benchmarks/auto/creation/qtgraphicaleffects/delegates_dropshadow.qml47
-rw-r--r--src/benchmarks/auto/creation/qtgraphicaleffects/delegates_lineargradient.qml22
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_argb.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_name.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date_object.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_matrix4x4.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_point.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_quaternion.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_rect.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_size.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_var_size.qml14
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_variant_size.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector2d.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector3d.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector4d.qml13
-rw-r--r--src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_cooperative.qml20
-rw-r--r--src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_immediate.qml20
-rw-r--r--src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_threaded.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_cooperative.qml20
-rw-r--r--src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_immediate.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_threaded.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_button.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_dial.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_label.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml47
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml24
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_slider.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_switch.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml24
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.image/delegates_image.qml23
-rw-r--r--src/benchmarks/auto/creation/quick.image/delegates_image_alpha.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.image/delegates_image_antialiased.qml25
-rw-r--r--src/benchmarks/auto/creation/quick.image/delegates_image_async.qml25
-rw-r--r--src/benchmarks/auto/creation/quick.image/delegates_image_solid.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item_bindings.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item_childrenRect.qml22
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item_empty.qml12
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item_empty_jscreation.qml34
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item_script.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item_states.qml29
-rw-r--r--src/benchmarks/auto/creation/quick.item/delegates_item_z.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.item/item_anchors.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.item/item_size.qml21
-rw-r--r--src/benchmarks/auto/creation/quick.rectangle/delegates_rect.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.rectangle/delegates_rect_blended.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.rectangle/delegates_rect_border.qml20
-rw-r--r--src/benchmarks/auto/creation/quick.rectangle/delegates_rect_gradient.qml20
-rw-r--r--src/benchmarks/auto/creation/quick.rectangle/delegates_rect_radius.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.text/comparison/delegates_kerning.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.text/comparison/delegates_nokerning.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.text/comparison/delegates_noshaping.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_longtext.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_longtext_arabic.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_longtext_chinese.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_longtext_hindi.qml20
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_arabic.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_chinese.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_decoration_bold.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_decoration_italic.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_decoration_strikeout.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_decoration_underline.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_elide.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_hindi.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_nativerendering.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_plain.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_richtext.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_text_styled.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_textedit.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.text/delegates_textinput.qml15
-rw-r--r--src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated.qml18
-rw-r--r--src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated_transform.qml21
-rw-r--r--src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled.qml19
-rw-r--r--src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled_transform.qml23
-rw-r--r--src/benchmarks/auto/creation/quick.transforms/delegates_item_translated.qml23
-rw-r--r--src/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml17
-rw-r--r--src/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml16
-rw-r--r--src/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml15
-rw-r--r--src/benchmarks/auto/creation/quick/compile.bat1
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_flickable.qml15
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_flipable.qml15
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_focusscope.qml16
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_fontloader.qml27
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_fontmetrics.qml27
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_gridview.qml16
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_listview.qml17
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_loader.qml23
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_mousearea.qml17
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_multipointtoucharea.qml17
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_pathview.qml18
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_pincharea.qml19
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_qobject.qml27
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_qobject_large_array.qml36
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_shadereffect.qml18
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_shadereffect_props.qml26
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_shadereffectsource.qml24
-rw-r--r--src/benchmarks/auto/creation/quick/delegates_textmetrics.qml29
-rw-r--r--src/benchmarks/auto/creation/quick/red.frag8
-rw-r--r--src/benchmarks/auto/creation/quick/red.frag.qsbbin0 -> 613 bytes
-rw-r--r--src/benchmarks/auto/js/date_getYear.qml13
-rw-r--r--src/benchmarks/auto/js/fib10.qml19
-rw-r--r--src/benchmarks/auto/js/sum10k.qml25
-rw-r--r--src/benchmarks/auto/js/sum10k_fixed.qml20
-rw-r--r--src/benchmarks/auto/layouts/gridlayout_large.qml36
-rw-r--r--src/benchmarks/auto/quick3d/lights.qml325
-rw-r--r--src/benchmarks/auto/quick3d/multiview.qml213
-rw-r--r--src/benchmarks/auto/quick3d/principledmaterial/PrincipledMaterial.qml158
-rw-r--r--src/benchmarks/auto/quick3d/principledmaterial/maps/OpenfootageNET_garage-1024.hdrbin0 -> 1675239 bytes
-rw-r--r--src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/basecolor.jpgbin0 -> 724020 bytes
-rw-r--r--src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/metallic.jpgbin0 -> 625742 bytes
-rw-r--r--src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/normal.jpgbin0 -> 332333 bytes
-rw-r--r--src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/roughness.jpgbin0 -> 600706 bytes
-rw-r--r--src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml79
-rw-r--r--src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml110
-rw-r--r--src/benchmarks/auto/quick3d/shapespawner/weirdShape.meshbin0 -> 228360 bytes
179 files changed, 4246 insertions, 0 deletions
diff --git a/src/benchmarks/auto/animations/comparison/README.md b/src/benchmarks/auto/animations/comparison/README.md
new file mode 100644
index 0000000..a5c441d
--- /dev/null
+++ b/src/benchmarks/auto/animations/comparison/README.md
@@ -0,0 +1,17 @@
+# comparison
+
+These benchmarks compare a number of different ways of moving images around, and
+are help validate the casual gaming idea which should be very viable with QML.
+
+The benchmarks give an indication of how many animated items can run
+simultaneously in the UI. It should be in the thousands.
+
+One quirk if you run these is that on a threaded renderloop, the animation one
+runs faster than animators. This is because the work is broken into two major
+chunks. One is doing the animation while the other is doing the batching in the
+renderer and scheduling the rendering. If those happen on separate threads, we
+get better parallelization so 'animation' comes out better.
+
+However, if you try again with QSG_RENDER_LOOP=windows in the environment,
+you'll see that if it all happens on the same thread, then animators are a bit
+cheaper (because they are simpler).
diff --git a/src/benchmarks/auto/animations/comparison/moving-images-animations.qml b/src/benchmarks/auto/animations/comparison/moving-images-animations.qml
new file mode 100644
index 0000000..e1ba723
--- /dev/null
+++ b/src/benchmarks/auto/animations/comparison/moving-images-animations.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.2
+import QmlBench 1.0
+
+// Move images around using Animation types, to be compared with a number of
+// other similar ways to move them around.
+Benchmark {
+ id: root;
+
+ count: 500
+ staticCount: 20000
+
+ Repeater {
+ model: root.count
+ Image {
+ source: "qrc:///shared/butterfly-wide.png"
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 40
+ height: 40
+
+ SequentialAnimation on rotation {
+ NumberAnimation { from: -10; to: 10; duration: 500; easing.type: Easing.InOutCubic }
+ NumberAnimation { from: 10; to: -10; duration: 500; easing.type: Easing.InOutCubic }
+ loops: Animation.Infinite
+ }
+ }
+ }
+}
diff --git a/src/benchmarks/auto/animations/comparison/moving-images-animators.qml b/src/benchmarks/auto/animations/comparison/moving-images-animators.qml
new file mode 100644
index 0000000..b0c17a1
--- /dev/null
+++ b/src/benchmarks/auto/animations/comparison/moving-images-animators.qml
@@ -0,0 +1,28 @@
+import QtQuick 2.2
+import QmlBench 1.0
+
+// Move images around using Animator types, to be compared with a number of
+// other similar ways to move them around.
+Benchmark {
+ id: root;
+
+ count: 500
+ staticCount: 20000
+
+ Repeater {
+ model: root.count
+ Image {
+ source: "qrc:///shared/butterfly-wide.png"
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 40
+ height: 40
+
+ SequentialAnimation on rotation {
+ RotationAnimator { from: -10; to: 10; duration: 500; easing.type: Easing.InOutCubic }
+ RotationAnimator { from: 10; to: -10; duration: 500; easing.type: Easing.InOutCubic }
+ loops: Animation.Infinite
+ }
+ }
+ }
+}
diff --git a/src/benchmarks/auto/animations/comparison/moving-images-script.qml b/src/benchmarks/auto/animations/comparison/moving-images-script.qml
new file mode 100644
index 0000000..54f0c0c
--- /dev/null
+++ b/src/benchmarks/auto/animations/comparison/moving-images-script.qml
@@ -0,0 +1,30 @@
+import QtQuick 2.2
+import QmlBench 1.0
+
+// Move images around using a property binding, to be compared with a number of
+// other similar ways to move them around.
+Benchmark {
+ id: root;
+
+ count: 500
+ staticCount: 20000
+
+ Repeater {
+ model: root.count
+ Image {
+ source: "qrc:///shared/butterfly-wide.png"
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 40
+ height: 40
+
+ property real t;
+ rotation: 10 * Math.sin(t * Math.PI * 2 + Math.PI);
+
+ SequentialAnimation on t {
+ NumberAnimation { from: 0; to: 1; duration: 1000; }
+ loops: Animation.Infinite
+ }
+ }
+ }
+}
diff --git a/src/benchmarks/auto/animations/comparison/moving-images-simple.qml b/src/benchmarks/auto/animations/comparison/moving-images-simple.qml
new file mode 100644
index 0000000..39cc05e
--- /dev/null
+++ b/src/benchmarks/auto/animations/comparison/moving-images-simple.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.2
+import QmlBench 1.0
+
+// Move images around using a global property binding, to be compared with a
+// number of other similar ways to move them around.
+Benchmark {
+ id: root;
+
+ count: 500
+ staticCount: 20000
+
+ property int frameCount
+ onTChanged: {
+ frameCount++
+ }
+
+ Repeater {
+ model: root.count
+ Image {
+ source: "qrc:///shared/butterfly-wide.png"
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 40
+ height: 40
+ rotation: index + frameCount
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/bindings/compositesingleton.qml b/src/benchmarks/auto/bindings/compositesingleton.qml
new file mode 100644
index 0000000..ae77357
--- /dev/null
+++ b/src/benchmarks/auto/bindings/compositesingleton.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import "qrc:///shared"
+
+// Tests the creation of Items bound to a QML-defined singleton
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: Globals.realProp
+ y: Globals.intProp
+ smooth: Globals.boolProp
+ }
+}
diff --git a/src/benchmarks/auto/canvas/canvas_text_simple.qml b/src/benchmarks/auto/canvas/canvas_text_simple.qml
new file mode 100644
index 0000000..7668a42
--- /dev/null
+++ b/src/benchmarks/auto/canvas/canvas_text_simple.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of canvas-based text rendering
+Item {
+ id: root;
+ property int count: 100;
+ property int staticCount: 1000;
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1; duration: 2347; loops: Animation.Infinite }
+
+ Canvas {
+ anchors.fill: parent
+
+ property real t: root.t;
+ onTChanged: requestPaint();
+
+ onPaint: {
+ var ctx = getContext("2d");
+ ctx.clearRect(0, 0, width, height);
+ var str = "" + Math.floor( t * 1000 ) / 1000;
+
+ for (var i = 0; i < root.count; ++i) {
+ ctx.fillText(str, QmlBench.getRandom() * root.width, QmlBench.getRandom() * root.height);
+ }
+ }
+ }
+}
diff --git a/src/benchmarks/auto/changes/README.md b/src/benchmarks/auto/changes/README.md
new file mode 100644
index 0000000..9e5a905
--- /dev/null
+++ b/src/benchmarks/auto/changes/README.md
@@ -0,0 +1,5 @@
+# changes
+
+These benchmarks help measure the impact of various types of changes in a scene
+(for instance, changing one text item out of many, changing all text items at
+once).
diff --git a/src/benchmarks/auto/changes/changing_over_isolated.qml b/src/benchmarks/auto/changes/changing_over_isolated.qml
new file mode 100644
index 0000000..72f9f1a
--- /dev/null
+++ b/src/benchmarks/auto/changes/changing_over_isolated.qml
@@ -0,0 +1,50 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// This benchmark determines if clipping two subtrees isolates them,
+// such that one changing subtree won't affect performance because
+// of the other.
+CreationBenchmark {
+ id: root;
+ count: 1000;
+ staticCount: 2000
+
+ // Boolean because: isolating via clip either keeps performance good, or
+ // performance is awful if we break it.
+ isBooleanResult: true;
+
+ // Create a static subtree of items. This tree does not change.
+ Item {
+ anchors.fill: parent
+ clip: true
+ Repeater {
+ id: repeater
+ model: root.count
+
+ Rectangle {
+ color: Qt.hsla(QmlBench.getRandom(), 0.9, 0.4)
+ width: 20
+ height: 20
+ x: QmlBench.getRandom() * root.width
+ y: QmlBench.getRandom() * root.height
+
+ Text {
+ color: "white"
+ text: "X"
+ anchors.centerIn: parent
+ font.pixelSize: 10
+ }
+ }
+ }
+ }
+
+ // Create a subtree containing a single item. This tree does change.
+ Item {
+ anchors.fill: parent
+ clip: true
+ Text {
+ anchors.centerIn: parent
+ text: "test: " + root.t;
+ }
+ }
+}
diff --git a/src/benchmarks/auto/changes/changing_over_isolated_with_clip.qml b/src/benchmarks/auto/changes/changing_over_isolated_with_clip.qml
new file mode 100644
index 0000000..487ed21
--- /dev/null
+++ b/src/benchmarks/auto/changes/changing_over_isolated_with_clip.qml
@@ -0,0 +1,49 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests that a single item changing in one subtree, and many items in another
+// tree, do not have bad performance when both subtrees are isolated with
+// "clip: true".
+Item {
+ id: root;
+ property int count: 100;
+ property int staticCount: 2000
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1; duration: 2347; loops: Animation.Infinite }
+
+ Item {
+ anchors.fill: parent
+ clip: true
+ Repeater {
+ id: repeater
+ model: root.count
+
+ Rectangle {
+ color: Qt.hsla(QmlBench.getRandom(), 0.9, 0.4)
+ width: 20
+ height: 20
+ x: QmlBench.getRandom() * root.width
+ y: QmlBench.getRandom() * root.height
+ clip: true
+
+ Text {
+ color: "white"
+ text: "X"
+ anchors.centerIn: parent
+ font.pixelSize: 10
+ }
+ }
+ }
+ }
+
+ Item {
+ anchors.fill: parent
+ clip: true
+ Text {
+ anchors.centerIn: parent
+ text: "test: " + root.t;
+ }
+ }
+
+}
diff --git a/src/benchmarks/auto/changes/changing_over_isolated_with_clip_rotated.qml b/src/benchmarks/auto/changes/changing_over_isolated_with_clip_rotated.qml
new file mode 100644
index 0000000..48dae1d
--- /dev/null
+++ b/src/benchmarks/auto/changes/changing_over_isolated_with_clip_rotated.qml
@@ -0,0 +1,57 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests that a single item changing in one subtree, and many items in another
+// tree, do not have bad performance when both subtrees are isolated with
+// "clip: true".
+//
+// Different from changing_over_isolated_with_clip, we also rotate, as this
+// can't just be clipped with scissoring.
+//
+// TODO: consider whether it makes sense to test this as a specific render
+// test, changing_over_isolated_with_clip covers the clipping part well enough
+// that perhaps we don't need this approach. Useful for now, though.
+Item {
+ id: root;
+ property int count: 1000;
+ property int staticCount: 2000
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1; duration: 2347; loops: Animation.Infinite }
+
+ Item {
+ anchors.fill: parent
+ clip: true
+ Repeater {
+ id: repeater
+ model: root.count
+
+ Rectangle {
+ color: Qt.hsla(QmlBench.getRandom(), 0.9, 0.4)
+ width: 20
+ height: 20
+ x: QmlBench.getRandom() * root.width
+ y: QmlBench.getRandom() * root.height
+ clip: true
+ rotation: 10
+
+ Text {
+ color: "white"
+ text: "X"
+ anchors.centerIn: parent
+ font.pixelSize: 10
+ }
+ }
+ }
+ }
+
+ Item {
+ anchors.fill: parent
+ clip: true
+ Text {
+ anchors.centerIn: parent
+ text: "test: " + root.t;
+ }
+ }
+
+}
diff --git a/src/benchmarks/auto/changes/changing_text_oneofmany.qml b/src/benchmarks/auto/changes/changing_text_oneofmany.qml
new file mode 100644
index 0000000..879b99b
--- /dev/null
+++ b/src/benchmarks/auto/changes/changing_text_oneofmany.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of changing 1 Text in a scene vs all (changing_texts)
+Item {
+ id: root;
+ property int count: 100
+ property int staticCount: 1000;
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1000; duration: 1000; loops: Animation.Infinite }
+
+ Repeater {
+ id: repeater
+ model: root.count
+ Text {
+ x: QmlBench.getRandom() * root.width
+ y: QmlBench.getRandom() * root.height
+ text: index == 0 ? Math.round(t) : index;
+ }
+ }
+}
diff --git a/src/benchmarks/auto/changes/changing_texts.qml b/src/benchmarks/auto/changes/changing_texts.qml
new file mode 100644
index 0000000..2715482
--- /dev/null
+++ b/src/benchmarks/auto/changes/changing_texts.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of changing all texts in a scene vs 1 (text_oneofmany)
+Item {
+ id: root;
+ property int count: 100;
+ property int staticCount: 1000;
+
+ property real t;
+ NumberAnimation on t { from: 0; to: 1; duration: 2347; loops: Animation.Infinite }
+
+ Repeater {
+ id: repeater
+ model: root.count
+ Text {
+ x: QmlBench.getRandom() * root.width
+ y: QmlBench.getRandom() * root.height
+ text: Math.floor( root.t * 1000 ) / 1000;
+ }
+ }
+}
diff --git a/src/benchmarks/auto/creation/README.md b/src/benchmarks/auto/creation/README.md
new file mode 100644
index 0000000..f0303d9
--- /dev/null
+++ b/src/benchmarks/auto/creation/README.md
@@ -0,0 +1,14 @@
+# creation
+
+This is a suite of tests to find out how good we are with creation, rendering
+and destruction of objects. Some of the tests are also written in such a way
+that they can be compared between each other -- these are usually noted in the
+descriptive comment at the top of the test.
+
+Creation is an important factor: our items should be light, as creating a dialog
+or page of UI can often creating a few hundred different items (especially Text,
+Item, Rectangle, etc). In addition to this, there's code outside of our control
+on the application end: JS logic, model interaction, database or file I/O all
+comes in addition - so we need to leave plenty of performance left over for the
+end user.
+
diff --git a/src/benchmarks/auto/creation/layouts/delegates_column.qml b/src/benchmarks/auto/creation/layouts/delegates_column.qml
new file mode 100644
index 0000000..55be106
--- /dev/null
+++ b/src/benchmarks/auto/creation/layouts/delegates_column.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of a Column, to be compared with ColumnLayout.
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: Column {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (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/src/benchmarks/auto/creation/layouts/delegates_columnlayout.qml b/src/benchmarks/auto/creation/layouts/delegates_columnlayout.qml
new file mode 100644
index 0000000..bbb3b44
--- /dev/null
+++ b/src/benchmarks/auto/creation/layouts/delegates_columnlayout.qml
@@ -0,0 +1,39 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Layouts 1.0
+
+// Tests the creation of a ColumnLayout, to be compared with Column.
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: ColumnLayout {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (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/src/benchmarks/auto/creation/layouts/delegates_flow.qml b/src/benchmarks/auto/creation/layouts/delegates_flow.qml
new file mode 100644
index 0000000..e7e1ad0
--- /dev/null
+++ b/src/benchmarks/auto/creation/layouts/delegates_flow.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of a Flow layout
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: Flow {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (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/src/benchmarks/auto/creation/layouts/delegates_grid.qml b/src/benchmarks/auto/creation/layouts/delegates_grid.qml
new file mode 100644
index 0000000..a5c7f5f
--- /dev/null
+++ b/src/benchmarks/auto/creation/layouts/delegates_grid.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of a Grid, to be compared with GridLayout
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: Grid {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (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/src/benchmarks/auto/creation/layouts/delegates_gridlayout.qml b/src/benchmarks/auto/creation/layouts/delegates_gridlayout.qml
new file mode 100644
index 0000000..0d152c8
--- /dev/null
+++ b/src/benchmarks/auto/creation/layouts/delegates_gridlayout.qml
@@ -0,0 +1,40 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Layouts 1.0
+
+// Tests the creation of GridLayout, to be compared with Grid
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: GridLayout {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (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/src/benchmarks/auto/creation/layouts/delegates_row.qml b/src/benchmarks/auto/creation/layouts/delegates_row.qml
new file mode 100644
index 0000000..8f3f8ae
--- /dev/null
+++ b/src/benchmarks/auto/creation/layouts/delegates_row.qml
@@ -0,0 +1,38 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Row, to be compared with RowLayout
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: Row {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (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/src/benchmarks/auto/creation/layouts/delegates_rowlayout.qml b/src/benchmarks/auto/creation/layouts/delegates_rowlayout.qml
new file mode 100644
index 0000000..4e001ea
--- /dev/null
+++ b/src/benchmarks/auto/creation/layouts/delegates_rowlayout.qml
@@ -0,0 +1,39 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Layouts 1.0
+
+// Tests the creation of RowLayout, to be compared with Row
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: RowLayout {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (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/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_bool.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_bool.qml
new file mode 100644
index 0000000..7baf491
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_bool.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS bool type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property bool value: true
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_double.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_double.qml
new file mode 100644
index 0000000..cbeafa8
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_double.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS double type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property double value: 42.0
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_int.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_int.qml
new file mode 100644
index 0000000..8ed7952
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_int.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS int type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property int value: 42
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_real.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_real.qml
new file mode 100644
index 0000000..576841f
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_real.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS real type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property real value: 42.0
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_string.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_string.qml
new file mode 100644
index 0000000..efa5cf4
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_string.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS string type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property string value: "42"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_url.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_url.qml
new file mode 100644
index 0000000..f8953e8
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_url.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS url type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property url value: "some.url/some.resource"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_array.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_array.qml
new file mode 100644
index 0000000..c9436b3
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_array.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS var type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property var value: [42]
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_bool.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_bool.qml
new file mode 100644
index 0000000..e514b6d
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_bool.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS var type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property var value: true
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_int.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_int.qml
new file mode 100644
index 0000000..9b87f70
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_int.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS var type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property var value: 42
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_object.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_object.qml
new file mode 100644
index 0000000..1fc5fd2
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_object.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS var type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property var value: { 42: true }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_string.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_string.qml
new file mode 100644
index 0000000..cc61b6d
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_var_string.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS var type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property var value: "42"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_array.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_array.qml
new file mode 100644
index 0000000..e220943
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_array.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS variant type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property var value: [42]
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_bool.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_bool.qml
new file mode 100644
index 0000000..478bfb4
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_bool.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS variant type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property variant value: true
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_int.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_int.qml
new file mode 100644
index 0000000..da3a5f9
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_int.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS variant type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property variant value: 42
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_object.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_object.qml
new file mode 100644
index 0000000..4b2a863
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_object.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS variant type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property variant value: { 42: true }
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_string.qml b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_string.qml
new file mode 100644
index 0000000..d8175f2
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.basictypes/delegates_basictype_variant_string.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS variant type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property variant value: "42"
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bool.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bool.qml
new file mode 100644
index 0000000..54f86f4
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bool.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of bool properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property bool value: model.boolRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bytearray.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bytearray.qml
new file mode 100644
index 0000000..1bd73e6
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_bytearray.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of bytearray properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property var value: model.byteArrayRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_color.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_color.qml
new file mode 100644
index 0000000..65cdd4f
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_color.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of color properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property color value: model.colorRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_datetime.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_datetime.qml
new file mode 100644
index 0000000..91205e9
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_datetime.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of datetime properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property date value: model.dateTimeRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_int.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_int.qml
new file mode 100644
index 0000000..5eb06bf
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_int.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of int properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property int value: model.intRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_jsvalue.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_jsvalue.qml
new file mode 100644
index 0000000..8e5d0fc
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_jsvalue.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of jsvalue properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property var value: model.jsValueRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_point.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_point.qml
new file mode 100644
index 0000000..d107e3b
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_point.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of point properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property point value: model.pointRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_real.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_real.qml
new file mode 100644
index 0000000..2d66c38
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_real.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of real properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property real value: model.realRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_rect.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_rect.qml
new file mode 100644
index 0000000..9caad53
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_rect.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of rect properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property rect value: model.rectRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_size.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_size.qml
new file mode 100644
index 0000000..be8d0ce
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_size.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of size properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property size value: model.sizeRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_string.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_string.qml
new file mode 100644
index 0000000..5217816
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_string.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of string properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property string value: model.stringRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_url.qml b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_url.qml
new file mode 100644
index 0000000..eb314bb
--- /dev/null
+++ b/src/benchmarks/auto/creation/qml.modelaccess/modelaccess_url.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests access of url properties from a C++ model
+Benchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+
+ onTChanged: {
+ testModel.rowNumber = 0
+ testModel.rowNumber = root.count
+ }
+
+ Repeater {
+ model: TestModel {
+ id: testModel
+ }
+ delegate: Item {
+ property url value: model.urlRole
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qtgraphicaleffects/delegates_dropshadow.qml b/src/benchmarks/auto/creation/qtgraphicaleffects/delegates_dropshadow.qml
new file mode 100644
index 0000000..075d74d
--- /dev/null
+++ b/src/benchmarks/auto/creation/qtgraphicaleffects/delegates_dropshadow.qml
@@ -0,0 +1,47 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the qmlbench tool.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import QmlBench 1.0
+
+CreationBenchmark {
+ id: root
+ count: 50
+ staticCount: 100
+ delegate: Rectangle {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ layer.enabled: true
+ layer.effect: DropShadow {
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/qtgraphicaleffects/delegates_lineargradient.qml b/src/benchmarks/auto/creation/qtgraphicaleffects/delegates_lineargradient.qml
new file mode 100644
index 0000000..2904bdc
--- /dev/null
+++ b/src/benchmarks/auto/creation/qtgraphicaleffects/delegates_lineargradient.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QtGraphicalEffects 1.0
+import QmlBench 1.0
+
+// Tests the creation of LinearGradient.
+// The values chosen match those in delegates_rect_gradient, so performance can be directly compared
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: LinearGradient {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#ff0000" }
+ GradientStop { position: 1.0; color: "#0000ff" }
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color.qml
new file mode 100644
index 0000000..f777a8e
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS color type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property color value: "#ff0000"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_argb.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_argb.qml
new file mode 100644
index 0000000..24582cb
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_argb.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS color type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property color value: "#ffff0000"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_name.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_name.qml
new file mode 100644
index 0000000..2815fc9
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_color_name.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS color type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property color value: "red"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date.qml
new file mode 100644
index 0000000..ea93f0e
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS Date type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property date value: "2000-01-01"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date_object.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date_object.qml
new file mode 100644
index 0000000..59c1655
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_date_object.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS Date type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property date value: new Date()
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_matrix4x4.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_matrix4x4.qml
new file mode 100644
index 0000000..b7112da
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_matrix4x4.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS matrix4x4 type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property matrix4x4 value: Qt.matrix4x4(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16);
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_point.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_point.qml
new file mode 100644
index 0000000..9b29234
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_point.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS point type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property point value: Qt.point(0, 20)
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_quaternion.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_quaternion.qml
new file mode 100644
index 0000000..304b373
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_quaternion.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS quaternion type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property quaternion value: Qt.quaternion(2, 17, 0.9, 0.6)
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_rect.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_rect.qml
new file mode 100644
index 0000000..297ec4c
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_rect.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS rect type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property rect value: Qt.rect(0, 0, 10, 10)
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_size.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_size.qml
new file mode 100644
index 0000000..e947cc1
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_size.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS size type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property size value: Qt.size(0, 150)
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_var_size.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_var_size.qml
new file mode 100644
index 0000000..b8edd7c
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_var_size.qml
@@ -0,0 +1,14 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS var type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property var value: Qt.size(0, 150)
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_variant_size.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_variant_size.qml
new file mode 100644
index 0000000..112df7f
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_variant_size.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS variant type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property variant value: Qt.size(0, 150)
+ }
+}
+
+
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector2d.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector2d.qml
new file mode 100644
index 0000000..09d13ac
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector2d.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS vector2d type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property vector2d value: Qt.vector2d(1, 2)
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector3d.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector3d.qml
new file mode 100644
index 0000000..29f9669
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector3d.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS vector3d type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property vector3d value: Qt.vector3d(1, 2, 0)
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector4d.qml b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector4d.qml
new file mode 100644
index 0000000..3db91fc
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.basictypes/delegates_basictype_vector4d.qml
@@ -0,0 +1,13 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of the JS vector4d type as a property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Item {
+ property vector4d value: Qt.vector4d(1, 2, 3, 4)
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_cooperative.qml b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_cooperative.qml
new file mode 100644
index 0000000..e9f7e49
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_cooperative.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of creating a canvas
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Canvas {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ renderTarget: Canvas.FramebufferObject
+ renderStrategy: Canvas.Cooperative
+ // *just* measuring canvas creation. nothing else.
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_immediate.qml b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_immediate.qml
new file mode 100644
index 0000000..f9f55b3
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_immediate.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of creating a canvas
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Canvas {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ renderTarget: Canvas.FramebufferObject
+ renderStrategy: Canvas.Immediate
+ // *just* measuring canvas creation. nothing else.
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_threaded.qml b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_threaded.qml
new file mode 100644
index 0000000..dd351f9
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_fbo_threaded.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of creating a canvas
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Canvas {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ renderTarget: Canvas.FramebufferObject
+ renderStrategy: Canvas.Threaded
+ // *just* measuring canvas creation. nothing else.
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_cooperative.qml b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_cooperative.qml
new file mode 100644
index 0000000..1c2be52
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_cooperative.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of creating a canvas
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Canvas {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ renderTarget: Canvas.Image
+ renderStrategy: Canvas.Cooperative
+ // *just* measuring canvas creation. nothing else.
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_immediate.qml b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_immediate.qml
new file mode 100644
index 0000000..3deb640
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_immediate.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of creating a canvas
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Canvas {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ renderTarget: Canvas.Image
+ renderStrategy: Canvas.Immediate
+ // *just* measuring canvas creation. nothing else.
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_threaded.qml b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_threaded.qml
new file mode 100644
index 0000000..49d2587
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.canvas/delegates_canvas_image_threaded.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of creating a canvas
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Canvas {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ renderTarget: Canvas.Image
+ renderStrategy: Canvas.Threaded
+ // *just* measuring canvas creation. nothing else.
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml
new file mode 100644
index 0000000..6706d51
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's BusyIndicator type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_button.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_button.qml
new file mode 100644
index 0000000..ab9b939
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_button.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's Button type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: Button {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "Button"
+ down: index % 2
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml
new file mode 100644
index 0000000..4603acb
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's CheckBox type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml
new file mode 100644
index 0000000..7eef93a
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's ComboBox type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_dial.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_dial.qml
new file mode 100644
index 0000000..a245f2c
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_dial.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's Dial type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml
new file mode 100644
index 0000000..61f7c64
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's ItemDelegate type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: ItemDelegate {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "ItemDelegate"
+ down: index % 2
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_label.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_label.qml
new file mode 100644
index 0000000..7624e90
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_label.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's Label type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: Label {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "Qt Quick!"
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml
new file mode 100644
index 0000000..71a5b98
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_menu_custom.qml
@@ -0,0 +1,47 @@
+import QmlBench 1.0
+import QtQuick 2.10
+import QtQuick.Controls 2.3
+
+CreationBenchmark {
+ id: root
+ count: 2
+ staticCount: 25
+
+ Component {
+ id: menuItemComponent
+
+ MenuItem {
+ contentItem: Text {
+ text: parent.text
+ color: "navajowhite"
+ }
+ background: Rectangle {
+ color: "steelblue"
+ }
+ }
+ }
+
+ delegate: Item {
+ Menu {
+ id: menu
+ title: "Root Menu"
+ delegate: menuItemComponent
+ visible: true
+
+ Menu {
+ title: "Sub-menu 1"
+ delegate: menuItemComponent
+
+ Menu {
+ title: "Sub-sub-menu"
+ delegate: menuItemComponent
+ }
+ }
+
+ Menu { title: "Sub-menu 2" }
+ Action { text: "Action 3" }
+ Action { text: "Action 4" }
+ Action { text: "Action 5" }
+ }
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml
new file mode 100644
index 0000000..adefbc7
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's MenuItem type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: MenuItem {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "MenuItem"
+ checkable: index % 2
+ checked: index % 2
+ down: index % 3
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml
new file mode 100644
index 0000000..6c2475d
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's ProgressBar type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml
new file mode 100644
index 0000000..86847cf
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's RadioButton type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: RadioButton {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "CheckBox"
+ autoExclusive: false
+ checked: index % 2
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml
new file mode 100644
index 0000000..8e73e9d
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's ScrollBar type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: ScrollBar {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ height: 100
+ size: index / root.staticCount
+ pressed: index % 2
+ active: true
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml
new file mode 100644
index 0000000..eea7e34
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.2
+
+// Tests the creation of QQC2's ScrollView type.
+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
+ }
+ ScrollBar.vertical.active: true
+ ScrollBar.vertical.pressed: index % 3 === 1
+ ScrollBar.horizontal.active: true
+ ScrollBar.horizontal.pressed: index % 3 === 2
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_slider.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_slider.qml
new file mode 100644
index 0000000..bf6df75
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_slider.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's Slider type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml
new file mode 100644
index 0000000..4ac4a95
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's SpinBox type.
+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 * to
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_switch.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_switch.qml
new file mode 100644
index 0000000..d780bd1
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_switch.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's Switch type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 1000
+ delegate: Switch {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ text: "Switch"
+ checked: index % 2
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml
new file mode 100644
index 0000000..418deb5
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml
@@ -0,0 +1,24 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's TabBar type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 250
+ delegate: TabBar {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ currentIndex: index / root.staticCount * count
+ TabButton {
+ text: "Tab1"
+ }
+ TabButton {
+ text: "Tab2"
+ }
+ TabButton {
+ text: "Tab3"
+ }
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml
new file mode 100644
index 0000000..28d1fb0
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's TextArea type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml
new file mode 100644
index 0000000..6f03459
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's TextField type.
+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/src/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml b/src/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml
new file mode 100644
index 0000000..9d80215
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+import QtQuick.Controls 2.0
+
+// Tests the creation of QQC2's Tumbler type.
+CreationBenchmark {
+ id: root
+ count: 20
+ staticCount: 250
+ delegate: Tumbler {
+ x: QmlBench.getRandom() * root.width - width
+ y: QmlBench.getRandom() * root.height - height
+ model: 5
+ currentIndex: index % count
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.image/delegates_image.qml b/src/benchmarks/auto/creation/quick.image/delegates_image.qml
new file mode 100644
index 0000000..93432ed
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.image/delegates_image.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test the creation of an Image with fairly stock settings (synchronous, no AA)
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ property var names: [
+ "butterfly-wide.png",
+ "butterfly-half.png",
+ "butterfly-collapsed.png"
+ ];
+
+ delegate: Image {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ source: "qrc:///shared/" + root.names[index % 3];
+ width: 20
+ height: 20
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.image/delegates_image_alpha.qml b/src/benchmarks/auto/creation/quick.image/delegates_image_alpha.qml
new file mode 100644
index 0000000..ba52256
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.image/delegates_image_alpha.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test the creation of an Image with an ARGB PNG
+// Compare with delegates_image_solid
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ delegate: Image {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ source: "qrc:///shared/alpha.png"
+ width: 20
+ height: 20
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.image/delegates_image_antialiased.qml b/src/benchmarks/auto/creation/quick.image/delegates_image_antialiased.qml
new file mode 100644
index 0000000..a61808b
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.image/delegates_image_antialiased.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test the creation of an antialiased image.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ property var names: [
+ "butterfly-wide.png",
+ "butterfly-half.png",
+ "butterfly-collapsed.png"
+ ];
+
+ delegate: Image {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ source: "qrc:///shared/" + root.names[index % 3];
+ width: 20
+ height: 20
+ antialiasing: true
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.image/delegates_image_async.qml b/src/benchmarks/auto/creation/quick.image/delegates_image_async.qml
new file mode 100644
index 0000000..80e13d6
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.image/delegates_image_async.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test the creation of an asynchronously loaded image.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ property var names: [
+ "butterfly-wide.png",
+ "butterfly-half.png",
+ "butterfly-collapsed.png"
+ ];
+
+ delegate: Image {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ source: "qrc:///shared/" + root.names[index % 3];
+ width: 20
+ height: 20
+ asynchronous: true
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.image/delegates_image_solid.qml b/src/benchmarks/auto/creation/quick.image/delegates_image_solid.qml
new file mode 100644
index 0000000..99ceba6
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.image/delegates_image_solid.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test the creation of an Image with an RGB PNG
+// Compare with delegates_image_alpha
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ delegate: Image {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ source: "qrc:///shared/solid.png"
+ width: 20
+ height: 20
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item.qml b/src/benchmarks/auto/creation/quick.item/delegates_item.qml
new file mode 100644
index 0000000..8d150f9
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Item with a few simple props.
+// Compare with delegates_item_empty, and delegates_item_empty_jscreation.
+// Compare with delegates_item_script.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 5000
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item_bindings.qml b/src/benchmarks/auto/creation/quick.item/delegates_item_bindings.qml
new file mode 100644
index 0000000..3dbcb13
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item_bindings.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Compare with delegates_item_states
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 5000
+ delegate: Item {
+ id: itemInstance
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ visible: 1 == 1 ? true : false
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item_childrenRect.qml b/src/benchmarks/auto/creation/quick.item/delegates_item_childrenRect.qml
new file mode 100644
index 0000000..d445f05
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item_childrenRect.qml
@@ -0,0 +1,22 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation involving Item's childrenRect property.
+// This is an unusually expensive property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 5000
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: childrenRect.width
+ height: childrenRect.height
+
+ Item {
+ width: 30
+ height: 15
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item_empty.qml b/src/benchmarks/auto/creation/quick.item/delegates_item_empty.qml
new file mode 100644
index 0000000..f635909
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item_empty.qml
@@ -0,0 +1,12 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of an empty Item.
+// Compare with delegates_item_empty_jscreation
+CreationBenchmark {
+ id: root
+ count: 50;
+ staticCount: 5000;
+ delegate: Item {
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item_empty_jscreation.qml b/src/benchmarks/auto/creation/quick.item/delegates_item_empty_jscreation.qml
new file mode 100644
index 0000000..89cded0
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item_empty_jscreation.qml
@@ -0,0 +1,34 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test allocation of Item, with no Repeater or anything.
+// Compare with delegates_qobject & delegates_item_empty.
+Benchmark {
+ id: root;
+ count: 50;
+ staticCount: 5000;
+
+ property var items;
+ onTChanged: {
+ allocate();
+ }
+
+ Component {
+ id: component;
+ Item {
+ }
+ }
+
+ function allocate() {
+ if (items && items.length) {
+ for (var i=0; i<items.length; ++i)
+ items[i].destroy();
+ }
+ items = [];
+
+ for (var i=0; i<root.count; ++i) {
+ var object = component.createObject(root);
+ items.push(object);
+ }
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item_script.qml b/src/benchmarks/auto/creation/quick.item/delegates_item_script.qml
new file mode 100644
index 0000000..37fbb54
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item_script.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Item with a few simple props (*not* bindings!)
+// Compare with delegates_item.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 5000
+ delegate: Item {
+ Component.onCompleted: {
+ x = QmlBench.getRandom() * (root.width - width)
+ y = QmlBench.getRandom() * (root.height - height)
+ width = 30
+ height = 15
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item_states.qml b/src/benchmarks/auto/creation/quick.item/delegates_item_states.qml
new file mode 100644
index 0000000..2163d61
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item_states.qml
@@ -0,0 +1,29 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Compare with delegates_item_bindings
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 5000
+ delegate: Item {
+ id: itemInstance
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ states: [
+ State {
+ name: "visible"
+ when: 1 == 1
+ PropertyChanges { target: itemInstance; visible: true }
+ },
+ State {
+ name: "invisible"
+ when: 0 == 1
+ PropertyChanges { target: itemInstance; visible: false }
+ }
+ ]
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.item/delegates_item_z.qml b/src/benchmarks/auto/creation/quick.item/delegates_item_z.qml
new file mode 100644
index 0000000..791bcab
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/delegates_item_z.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Item with a non-zero z.
+// This is an unusually expensive property.
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 5000
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ z: index
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.item/item_anchors.qml b/src/benchmarks/auto/creation/quick.item/item_anchors.qml
new file mode 100644
index 0000000..1e0e8cc
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/item_anchors.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of anchors against w/h bindings (item_size).
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+
+ Item {
+ anchors.fill: parent
+ }
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.item/item_size.qml b/src/benchmarks/auto/creation/quick.item/item_size.qml
new file mode 100644
index 0000000..cc02942
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.item/item_size.qml
@@ -0,0 +1,21 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Testing the performance of w/h bindings against anchors (item_anchors).
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+
+ Item {
+ width: parent.width
+ height: parent.height
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.rectangle/delegates_rect.qml b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect.qml
new file mode 100644
index 0000000..a840b1c
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of rectangles with *NO* alpha channel.
+// Compare with delegates_rect_blended & delegates_rect_radius
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Rectangle {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ color: "steelblue"
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_blended.qml b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_blended.qml
new file mode 100644
index 0000000..5baa902
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_blended.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of rectangles with an alpha channel.
+// Compare with delegates_rect & delegates_rect_radius
+CreationBenchmark {
+ id: root;
+ count: 50
+ staticCount: 2500
+ delegate: Rectangle {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ color: Qt.hsla(0.7, 0.3, 0.6, 0.5);
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_border.qml b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_border.qml
new file mode 100644
index 0000000..86a47c2
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_border.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of rectangles with a border
+// Compare with delegates_rect
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Rectangle {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ color: "steelblue"
+ border.width: 5
+ border.color: "#000000"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_gradient.qml b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_gradient.qml
new file mode 100644
index 0000000..85c3158
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.rectangle/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "#ff0000" }
+ GradientStop { position: 1.0; color: "#0000ff" }
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_radius.qml b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_radius.qml
new file mode 100644
index 0000000..693ede4
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.rectangle/delegates_rect_radius.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of rectangles with rounded corners.
+// Compare with delegates_rect_blended & delegates_rect
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Rectangle {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ color: "steelblue"
+ radius: 10
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/comparison/delegates_kerning.qml b/src/benchmarks/auto/creation/quick.text/comparison/delegates_kerning.qml
new file mode 100644
index 0000000..0782c4a
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/comparison/delegates_kerning.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with no special flags set.
+// Used as baseline for delegates_nokerning and delegates_shaping
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "OATS FLAVOUR WAY"
+ font.family: "Times New Roman"
+ font.pixelSize: 10
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/comparison/delegates_nokerning.qml b/src/benchmarks/auto/creation/quick.text/comparison/delegates_nokerning.qml
new file mode 100644
index 0000000..9b9cbac
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/comparison/delegates_nokerning.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with kerning disabled.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "OATS FLAVOUR WAY"
+ font.family: "Times New Roman"
+ font.kerning: false
+ font.pixelSize: 10
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/comparison/delegates_noshaping.qml b/src/benchmarks/auto/creation/quick.text/comparison/delegates_noshaping.qml
new file mode 100644
index 0000000..5a29ff2
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/comparison/delegates_noshaping.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with shaping disabled.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "OATS FLAVOUR WAY"
+ font.family: "Times New Roman"
+ font.preferShaping: false
+ font.pixelSize: 10
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_longtext.qml b/src/benchmarks/auto/creation/quick.text/delegates_longtext.qml
new file mode 100644
index 0000000..806d996
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_longtext.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a long string of latin1 text.
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 500;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: root.width * 0.33
+ wrapMode: Text.WordWrap
+ font.pixelSize: 10
+ text: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc in volutpat nibh, ut convallis neque. Nam placerat tellus et ante feugiat condimentum. Nulla facilisi. Sed in lobortis magna. Duis eu mattis ante. Donec pulvinar ante est, ac ultricies elit commodo vitae. Sed ut luctus odio, quis aliquet metus. Curabitur quis lacus fringilla, luctus justo id, volutpat dui. Aliquam id nunc gravida, pharetra augue ac, tristique nibh."
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_longtext_arabic.qml b/src/benchmarks/auto/creation/quick.text/delegates_longtext_arabic.qml
new file mode 100644
index 0000000..fd3434c
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_longtext_arabic.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a long string of arabic text.
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 500;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: root.width * 0.33
+ wrapMode: Text.WordWrap
+ font.pixelSize: 10
+ text: "عل الدمج والمانيا حين. تحت سقوط انذار ان. ودول الخارجية و كلّ. جمعت والتي الساحل في ومن. أن لها أدوات مهمّات الأبرياء. شاسعة المحيط الساحلية ومن قد, فعل إختار العصبة التخطيط ان, هو فسقط موالية ولم. عرض و ببعض كردة إعلان, بين ثم سكان واستمرت المؤلّفة. لم مكن ألمّ اتفاق نتيجة, هُزم الجديدة، إيو بـ, به، عن انذار المارق الآلاف. اتفاق وإعلان بريطانيا، ان بحث, بعد ٣٠ قبضتهم الغالي الجنود. فصل تم وقام جسيمة, يعبأ وبدون الموسوعة ان تعد. ٢٠٠٤ وتتحمّل التخطيط وفي عل."
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_longtext_chinese.qml b/src/benchmarks/auto/creation/quick.text/delegates_longtext_chinese.qml
new file mode 100644
index 0000000..95526ec
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_longtext_chinese.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a long string of chinese text.
+// This is similar to longtext.qml, but it has a lot more glyphs.
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 500;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: root.width * 0.33
+ wrapMode: Text.WordWrap
+ font.pixelSize: 10
+ text: "天地玄黄,宇宙洪荒。日月盈昃,辰宿列张。寒来暑往,秋收冬藏。闰余成岁,律吕调阳。云腾致雨,露结为霜。金生丽水,玉出崑冈。剑号巨阙,珠称夜光。果珍李柰,菜重芥姜。海咸河淡,鳞潜羽翔。龙师火帝,鸟官人皇。始制文字,乃服衣裳。推位让国,有虞陶唐。弔民伐罪,周发商汤。坐朝问道,垂拱平章。爱育黎首,臣伏戎羌。遐迩壹体,率宾归王。鸣凤在竹,白驹食场。化被草木,赖及万方。盖此身发,四大五常。恭惟鞠养,岂敢毁伤。女慕贞洁,男效才良。知过必改,得能莫忘。罔谈彼短,靡恃己长。信使可覆,器欲难量。墨悲丝染,诗讚羔羊。景行维贤,克念作圣。德建名立,形端表正。空谷传声,虚堂习听。祸因恶积,福缘善庆。尺璧非宝,寸阴是竞。资父事君,曰严与敬。孝当竭力,忠则尽命。临深履薄,夙兴温清。似兰斯馨,如松之盛。川流不息,渊澄取映。容止若思,言辞安定。笃初诚美,慎终宜令。荣业所基,籍甚无竟。学优登仕,摄职从政。存以甘棠,去而益咏。乐殊贵贱,礼别尊卑。上和下睦,夫唱妇随。外受傅训,入奉母仪。诸姑伯叔,犹子比儿。孔怀兄弟,同气连枝。交友投分,切磨箴规。仁慈隐恻,造次弗离。节义廉退,颠沛匪亏。性静情逸,心动神疲。守真志满,逐物意移。坚持雅操,好爵自縻。都邑华夏,东西二京。背邙面洛,浮渭据泾。宫殿盘郁,楼观飞惊。图写禽兽,画彩仙灵。丙舍傍启,甲帐对楹。肆筵设席,鼓瑟吹笙。升阶纳陛,弁转疑星。右通广内,左达承明。既集坟典,亦聚群英。杜稿钟隶,漆书壁经。府罗将相,路侠槐卿。户封八县,家给千兵。高冠陪辇,驱毂振缨。世禄侈富,车驾肥轻。策功茂实,勒碑刻铭。磻溪伊尹,佐时阿衡。奄宅曲阜,微旦孰营。桓公匡合,济弱扶倾。绮迥汉惠,说感武丁。俊乂密勿,多士寔宁。晋楚更霸,赵魏困横。假途灭虢,践土会盟。何遵约法,韩弊烦刑。起翦颇牧,用军最精。宣威沙漠,驰誉丹青。九州禹迹,百郡秦并。嶽宗泰岱,禅主云亭。雁门紫塞,鸡田赤城。昆池碣石,钜野洞庭。旷远绵邈,巖岫杳冥。治本于农,务兹稼穑。俶载南亩,我蓺黍稷。税熟贡新,劝赏黜陟。孟轲敦素,史鱼秉直。庶几中庸,劳谦谨敕。聆音察理,鉴貌辨色。贻厥嘉猷,勉其祇植。省躬讥诫,宠增抗极。殆辱近耻,林皋幸即。两疏见机,解组谁逼。索居閒处,沉默寂寥。求古寻论,散虑逍遥。欣奏累遣,戚谢欢招。渠荷的历,园莽抽条。枇杷晚翠,梧桐早凋。陈根委翳,落叶飘飖。游鲲独运,凌摩绛霄。耽读翫市,寓目囊箱。易輶攸畏,属耳垣墙。具膳餐饭,适口充肠。饱饫烹宰,饥厌糟糠。亲戚故旧,老少异粮。妾御织纺,侍巾帷房。纨扇圆絜,银烛炜煌。昼眠夕寐,蓝笋象床。弦歌酒䜩,接杯举觞。矫手顿足,悦豫且康。嫡后嗣续,祭祀蒸尝。稽颡再拜,悚惧恐惶。笺牒简要,顾答审详。骸垢想浴,执热愿凉。驴骡犊特,骇跃超骧。诛斩贼盗,捕获叛亡。布射辽丸,嵇琴阮啸。恬笔伦纸,钧巧任钓。释纷利俗,并皆佳妙。毛施淑姿,工颦妍笑。年矢每催,曦晖朗曜。璇玑悬斡,晦魄环照。指薪修祜,永绥吉劭。矩步引领,俯仰廊庙。束带矜庄,徘徊瞻眺。孤陋寡闻,愚蒙等诮。谓语助者,焉哉乎也。"
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_longtext_hindi.qml b/src/benchmarks/auto/creation/quick.text/delegates_longtext_hindi.qml
new file mode 100644
index 0000000..5f7aca0
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_longtext_hindi.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a long string of hindi text.
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 500;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: root.width * 0.33
+ wrapMode: Text.WordWrap
+ font.pixelSize: 10
+ text: "गोपनीयता लाभान्वित अमितकुमार विभाग बहुत जानते बदले गटकउसि भोगोलिक बीसबतेबोध यायेका वर्तमान दस्तावेज अपने नवंबर परस्पर विस्तरणक्षमता मुक्त मेमत समजते लगती क्षमता खरिदने तकनिकल बाजार भोगोलिक सम्पर्क जिवन ध्येय विश्वास पहोचाना उपलब्धता सकता विश्व ब्रौशर एसेएवं सुचनाचलचित्र सहित वेबजाल आवश्यकत कार्यसिधान्तो विशेष किके कार्य बाधा ऎसाजीस समस्याए निर्माता पुर्णता बीसबतेबोध भाति चुनने उपेक्ष विकसित विश्लेषण नीचे दौरान आपको मुख्यतह विचारशिलता कराना कार्य लगती वातावरण सार्वजनिक जोवे व्यवहार मार्गदर्शन विशेष आजपर पहोच। पुर्णता विचरविमर्श विकासक्षमता शीघ्र पुस्तक आशाआपस कार्यकर्ता वहहर नाकर असक्षम प्राप्त आंतरजाल विवरन जाता जिसकी सभीकुछ परिभाषित शीघ्र निर्देश मुख्यतह बिना"
+
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text.qml b/src/benchmarks/auto/creation/quick.text/delegates_text.qml
new file mode 100644
index 0000000..95a72a4
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a short string of text
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_arabic.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_arabic.qml
new file mode 100644
index 0000000..b209113
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_arabic.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a short string of arabic text
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "مع مئات"
+ font.pixelSize: 10
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_chinese.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_chinese.qml
new file mode 100644
index 0000000..1be0b0c
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_chinese.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a short string of chinese text
+// This is similar to delegates_text, except with more glyphs
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ font.pixelSize: 10
+ text: "天地玄黄,宇宙洪荒。日月盈昃,辰宿列张。寒来暑往,秋收冬藏。闰余成岁,律吕调阳。云腾致雨,露结为霜。金生丽水,玉出崑冈。剑号巨阙,珠称夜光。果珍李柰,菜重芥姜。海咸河淡,鳞潜羽翔。龙师火帝,鸟官人皇。始制文字,乃服衣裳。推位让国,有虞陶唐。弔民伐罪,周发商汤。坐朝问道,垂拱平章。爱育黎首,臣伏戎羌。"
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_bold.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_bold.qml
new file mode 100644
index 0000000..8af788e
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_bold.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with bold decoration
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ font.bold: true
+ textFormat: Text.PlainText
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_italic.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_italic.qml
new file mode 100644
index 0000000..c4b4f32
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_italic.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with italic decoration
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ font.italic: true
+ textFormat: Text.PlainText
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_strikeout.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_strikeout.qml
new file mode 100644
index 0000000..e634a73
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_strikeout.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with strikeout decoration
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ font.strikeout: true
+ textFormat: Text.PlainText
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_underline.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_underline.qml
new file mode 100644
index 0000000..e61efe1
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_decoration_underline.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with underline decoration
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ font.underline: true
+ textFormat: Text.PlainText
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_elide.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_elide.qml
new file mode 100644
index 0000000..a0743eb
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_elide.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a long string of text that is elided on the right
+CreationBenchmark {
+ id: root
+ count: 50
+ staticCount: 1000
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 40
+ text: "Some very very very long text"
+ font.pixelSize: 10
+ elide: Text.ElideRight
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_hindi.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_hindi.qml
new file mode 100644
index 0000000..2fecb49
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_hindi.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with a short piece of hindi text
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "गोपनीयता लाभान्वित"
+ font.pixelSize: 10
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_nativerendering.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_nativerendering.qml
new file mode 100644
index 0000000..2927c48
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_nativerendering.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with native rendering enabled
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ renderType: Text.NativeRendering
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_plain.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_plain.qml
new file mode 100644
index 0000000..a060e9d
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_plain.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with plain formatting forced
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ textFormat: Text.PlainText
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_richtext.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_richtext.qml
new file mode 100644
index 0000000..99aaa71
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_richtext.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with rich formatting forced
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ textFormat: Text.RichText
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_text_styled.qml b/src/benchmarks/auto/creation/quick.text/delegates_text_styled.qml
new file mode 100644
index 0000000..c89d22d
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_text_styled.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Text with styled formatting forced
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Text {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ textFormat: Text.StyledText
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_textedit.qml b/src/benchmarks/auto/creation/quick.text/delegates_textedit.qml
new file mode 100644
index 0000000..cf7921b
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_textedit.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of TextEdit
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: TextEdit {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.text/delegates_textinput.qml b/src/benchmarks/auto/creation/quick.text/delegates_textinput.qml
new file mode 100644
index 0000000..727c9ea
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.text/delegates_textinput.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of TextInput
+CreationBenchmark {
+ id: root;
+ count: 20;
+ staticCount: 1000;
+ delegate: TextInput {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ text: "Qt Quick!"
+ font.pixelSize: 10
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated.qml b/src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated.qml
new file mode 100644
index 0000000..f7b9ed2
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated.qml
@@ -0,0 +1,18 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Rotate an Item.
+// Compare with delegates_item_rotated_transform.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ rotation: 45
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated_transform.qml b/src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated_transform.qml
new file mode 100644
index 0000000..f1a2e8f
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.transforms/delegates_item_rotated_transform.qml
@@ -0,0 +1,21 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Rotate an Item.
+// Compare with delegates_item_rotated_transform.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ transform: Rotation {
+ angle: 45
+ }
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled.qml b/src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled.qml
new file mode 100644
index 0000000..d8c0c74
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Scale an Item.
+// Compare with delegates_item_scaled_transform.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ scale: 10
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled_transform.qml b/src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled_transform.qml
new file mode 100644
index 0000000..851fcb8
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.transforms/delegates_item_scaled_transform.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Scale an Item.
+// Compare with delegates_item_scaled.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ transform: Scale {
+ xScale: 10
+ yScale: 10
+ }
+ }
+}
+
+
+
diff --git a/src/benchmarks/auto/creation/quick.transforms/delegates_item_translated.qml b/src/benchmarks/auto/creation/quick.transforms/delegates_item_translated.qml
new file mode 100644
index 0000000..8669e29
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.transforms/delegates_item_translated.qml
@@ -0,0 +1,23 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Translate an item.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ transform: Translate {
+ x: 10
+ y: 10
+ }
+ }
+}
+
+
+
+
diff --git a/src/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml b/src/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml
new file mode 100644
index 0000000..4fb6f30
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.validators/delegates_doublevalidator.qml
@@ -0,0 +1,17 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of DoubleValidator
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ property DoubleValidator validator: DoubleValidator {
+ top: 100
+ bottom: 0
+ decimals: 2
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml b/src/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml
new file mode 100644
index 0000000..f99040b
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.validators/delegates_intvalidator.qml
@@ -0,0 +1,16 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of IntValidator
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ property IntValidator validator: IntValidator {
+ top: 100
+ bottom: 0
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml b/src/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml
new file mode 100644
index 0000000..b3b8d38
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick.validators/delegates_regexpvalidator.qml
@@ -0,0 +1,15 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of RegExpValidator
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+ delegate: Item {
+ property RegExpValidator validator: RegExpValidator {
+ regExp: /.*/
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick/compile.bat b/src/benchmarks/auto/creation/quick/compile.bat
new file mode 100644
index 0000000..e0eeb95
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick/compile.bat
@@ -0,0 +1 @@
+qsb --glsl "100 es,120,150" --hlsl 50 --msl 12 -o red.frag.qsb red.frag
diff --git a/src/benchmarks/auto/creation/quick/delegates_flickable.qml b/src/benchmarks/auto/creation/quick/delegates_flickable.qml
new file mode 100644
index 0000000..303570e
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick/delegates_flipable.qml b/src/benchmarks/auto/creation/quick/delegates_flipable.qml
new file mode 100644
index 0000000..15a29b3
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick/delegates_focusscope.qml b/src/benchmarks/auto/creation/quick/delegates_focusscope.qml
new file mode 100644
index 0000000..059ae2f
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_fontloader.qml b/src/benchmarks/auto/creation/quick/delegates_fontloader.qml
new file mode 100644
index 0000000..354552b
--- /dev/null
+++ b/src/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/src/benchmarks/auto/creation/quick/delegates_fontmetrics.qml b/src/benchmarks/auto/creation/quick/delegates_fontmetrics.qml
new file mode 100644
index 0000000..849dc0b
--- /dev/null
+++ b/src/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/src/benchmarks/auto/creation/quick/delegates_gridview.qml b/src/benchmarks/auto/creation/quick/delegates_gridview.qml
new file mode 100644
index 0000000..386d865
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_listview.qml b/src/benchmarks/auto/creation/quick/delegates_listview.qml
new file mode 100644
index 0000000..413bbb2
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_loader.qml b/src/benchmarks/auto/creation/quick/delegates_loader.qml
new file mode 100644
index 0000000..7271f15
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ sourceComponent: anItemComponent
+ }
+
+ Component {
+ id: anItemComponent
+ Item {
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_mousearea.qml b/src/benchmarks/auto/creation/quick/delegates_mousearea.qml
new file mode 100644
index 0000000..eaf3ad0
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ hoverEnabled: true
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_multipointtoucharea.qml b/src/benchmarks/auto/creation/quick/delegates_multipointtoucharea.qml
new file mode 100644
index 0000000..68b4976
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_pathview.qml b/src/benchmarks/auto/creation/quick/delegates_pathview.qml
new file mode 100644
index 0000000..f370e3b
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_pincharea.qml b/src/benchmarks/auto/creation/quick/delegates_pincharea.qml
new file mode 100644
index 0000000..b89efc6
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ }
+}
+
+
+
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_qobject.qml b/src/benchmarks/auto/creation/quick/delegates_qobject.qml
new file mode 100644
index 0000000..2bd8d52
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick/delegates_qobject.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test allocation of QObject, with no Repeater or anything.
+// Compare with delegates_qobject.
+Benchmark {
+ id: root;
+ count: 50;
+ staticCount: 10000;
+
+ onTChanged: {
+ allocate();
+ }
+
+ Component {
+ id: component;
+ QtObject {
+ }
+ }
+
+ function allocate() {
+ for (var i=0; i<root.count; ++i) {
+ var object = component.createObject();
+ object.destroy();
+ }
+ }
+}
diff --git a/src/benchmarks/auto/creation/quick/delegates_qobject_large_array.qml b/src/benchmarks/auto/creation/quick/delegates_qobject_large_array.qml
new file mode 100644
index 0000000..01fc3cf
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick/delegates_qobject_large_array.qml
@@ -0,0 +1,36 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Test allocation of QObject, with no Repeater or anything, stored in a JS
+// array. The array is interesting as it's a large GC'd allocation.
+// Compare with delegates_qobject.
+Benchmark {
+ id: root;
+ count: 50;
+ staticCount: 10000;
+
+ property var items;
+ onTChanged: {
+ allocate();
+ }
+
+ Component {
+ id: component;
+ QtObject {
+ }
+ }
+
+ function allocate() {
+ if (items && items.length) {
+ for (var i=0; i<items.length; ++i)
+ items[i].destroy();
+ }
+ items = [];
+
+ for (var i=0; i<root.count; ++i) {
+ var object = component.createObject();
+ items.push(object);
+ }
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_shadereffect.qml b/src/benchmarks/auto/creation/quick/delegates_shadereffect.qml
new file mode 100644
index 0000000..b81ba5c
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ fragmentShader: "red.frag.qsb"
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_shadereffect_props.qml b/src/benchmarks/auto/creation/quick/delegates_shadereffect_props.qml
new file mode 100644
index 0000000..4aa855b
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick/delegates_shadereffect_props.qml
@@ -0,0 +1,26 @@
+import QtQuick 2.4
+import QmlBench 1.0
+
+// Tests the creation of ShaderEffect with custom properties,
+// as these add additional cost
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 2500;
+
+ Image {
+ id: sourceImage
+ source: "qrc:///shared/butterfly-wide.png"
+ }
+
+ delegate: ShaderEffect {
+ x: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: sourceImage.width
+ height: sourceImage.height
+ supportsAtlasTextures: true
+ property var source: sourceImage
+ }
+}
+
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_shadereffectsource.qml b/src/benchmarks/auto/creation/quick/delegates_shadereffectsource.qml
new file mode 100644
index 0000000..4e021a6
--- /dev/null
+++ b/src/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: QmlBench.getRandom() * (root.width - width)
+ y: QmlBench.getRandom() * (root.height - height)
+ width: 30
+ height: 15
+ sourceItem: sourceRectItem
+ }
+
+ Rectangle {
+ id: sourceRectItem
+ color: "#ff0000"
+ width: 30
+ height: 15
+ }
+}
+
diff --git a/src/benchmarks/auto/creation/quick/delegates_textmetrics.qml b/src/benchmarks/auto/creation/quick/delegates_textmetrics.qml
new file mode 100644
index 0000000..33a9506
--- /dev/null
+++ b/src/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"
+ }
+ }
+}
+
+
+
diff --git a/src/benchmarks/auto/creation/quick/red.frag b/src/benchmarks/auto/creation/quick/red.frag
new file mode 100644
index 0000000..2aa500e
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick/red.frag
@@ -0,0 +1,8 @@
+#version 440
+
+layout(location = 0) out vec4 fragColor;
+
+void main()
+{
+ fragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
diff --git a/src/benchmarks/auto/creation/quick/red.frag.qsb b/src/benchmarks/auto/creation/quick/red.frag.qsb
new file mode 100644
index 0000000..5bae5c1
--- /dev/null
+++ b/src/benchmarks/auto/creation/quick/red.frag.qsb
Binary files differ
diff --git a/src/benchmarks/auto/js/date_getYear.qml b/src/benchmarks/auto/js/date_getYear.qml
new file mode 100644
index 0000000..2e2639a
--- /dev/null
+++ b/src/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()
+ }
+}
diff --git a/src/benchmarks/auto/js/fib10.qml b/src/benchmarks/auto/js/fib10.qml
new file mode 100644
index 0000000..7e0df4f
--- /dev/null
+++ b/src/benchmarks/auto/js/fib10.qml
@@ -0,0 +1,19 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of Items with a recursive function binding
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Item {
+ x: fib(10);
+ }
+
+ function fib(n) {
+ if (n < 2)
+ return Math.max(0, n);
+ else
+ return fib(n-1) + fib(n-2);
+ }
+}
diff --git a/src/benchmarks/auto/js/sum10k.qml b/src/benchmarks/auto/js/sum10k.qml
new file mode 100644
index 0000000..ed9850f
--- /dev/null
+++ b/src/benchmarks/auto/js/sum10k.qml
@@ -0,0 +1,25 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of items with a non-recursive function binding
+// Note: Through an unfortunate oversight, this benchmark is mildly broken.
+// The loop never updates the 'x' value. However, this benchmark has already
+// given some insights, and changing it (as any other benchmark) would
+// invalidate past data causing confusion, so it has not been altered.
+//
+// See sum10k_fixed for a working version.
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Item {
+ x: sum(10000);
+ }
+
+ function sum(n) {
+ var x = 0;
+ for (var i=0; i<n; ++i)
+ x = x + x;
+ return x;
+ }
+}
diff --git a/src/benchmarks/auto/js/sum10k_fixed.qml b/src/benchmarks/auto/js/sum10k_fixed.qml
new file mode 100644
index 0000000..b638a94
--- /dev/null
+++ b/src/benchmarks/auto/js/sum10k_fixed.qml
@@ -0,0 +1,20 @@
+import QtQuick 2.0
+import QmlBench 1.0
+
+// Tests the creation of items with a non-recursive function binding
+CreationBenchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+ delegate: Item {
+ x: sum(10000);
+ }
+
+ function sum(n) {
+ var x = 0;
+ for (var i=0; i<n; ++i)
+ x = x + 1;
+ return x;
+ }
+}
+
diff --git a/src/benchmarks/auto/layouts/gridlayout_large.qml b/src/benchmarks/auto/layouts/gridlayout_large.qml
new file mode 100644
index 0000000..340a468
--- /dev/null
+++ b/src/benchmarks/auto/layouts/gridlayout_large.qml
@@ -0,0 +1,36 @@
+import QtQuick 2.2
+import QmlBench 1.0
+import QtQuick.Layouts 1.3
+
+Benchmark {
+ id: root;
+ count: 50;
+ staticCount: 1000;
+
+ // For each frame, change each child item of the layout:
+ // * Layout.rowSpan
+ // * Layout.columnSpan
+
+ property int frameCounter : 0
+ onTChanged: {
+ frameCounter++
+ }
+ GridLayout {
+ columns: 100
+ Repeater {
+ id: repeater
+ model: root.count
+ Rectangle {
+ color: Qt.hsla((index / 50) % 1, 1.0, 0.8)
+ Layout.columnSpan: (index * 3) % 17 + 1 + frameCounter % 10
+ Layout.rowSpan: (index * 5) % 17 + 1 + frameCounter % 10
+ implicitWidth: 0
+ implicitHeight: 0
+ Layout.fillWidth: true
+ Layout.fillHeight: true
+ }
+ }
+ }
+}
+
+
diff --git a/src/benchmarks/auto/quick3d/lights.qml b/src/benchmarks/auto/quick3d/lights.qml
new file mode 100644
index 0000000..07439c1
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/lights.qml
@@ -0,0 +1,325 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick3D
+import QmlBench
+
+Benchmark {
+ id: root;
+ count: 1; // Unused
+ staticCount: 1; // Unused
+
+ width: 1280
+ height: 720
+ visible: true
+
+ View3D {
+ anchors.fill: parent
+
+ environment: SceneEnvironment {
+ clearColor: "#808080"
+ backgroundMode: SceneEnvironment.Color
+ antialiasingMode: SceneEnvironment.MSAA
+ antialiasingQuality: SceneEnvironment.High
+ }
+
+ PerspectiveCamera {
+ position: Qt.vector3d(0, 400, 600)
+ eulerRotation.x: -30
+ clipFar: 2000
+ }
+
+ DirectionalLight {
+ id: light1
+ color: Qt.rgba(1.0, 0.1, 0.1, 1.0)
+ ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0)
+ position: Qt.vector3d(0, 200, 0)
+ rotation: Quaternion.fromEulerAngles(-135, -90, 0)
+ shadowMapQuality: Light.ShadowMapQualityHigh
+ visible: true
+ castsShadow: true
+ brightness: 0.5
+ SequentialAnimation on rotation {
+ loops: Animation.Infinite
+ QuaternionAnimation {
+ to: Quaternion.fromEulerAngles(-45, -90, 0)
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ QuaternionAnimation {
+ to: Quaternion.fromEulerAngles(-135, -90, 0)
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ PointLight {
+ id: light2
+ color: Qt.rgba(0.1, 1.0, 0.1, 1.0)
+ ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0)
+ position: Qt.vector3d(0, 300, 0)
+ shadowMapFar: 2000
+ shadowMapQuality: Light.ShadowMapQualityHigh
+ visible: true
+ castsShadow: true
+ brightness: 0.5
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: 400
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ PointLight {
+ id: light3
+ color: Qt.rgba(0.1, 1.0, 0.1, 1.0)
+ ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0)
+ position: Qt.vector3d(0, 300, 0)
+ shadowMapFar: 2000
+ shadowMapQuality: Light.ShadowMapQualityHigh
+ visible: true
+ castsShadow: true
+ brightness: 0.5
+ SequentialAnimation on x {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: -400
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ PointLight {
+ id: light2b
+ color: Qt.rgba(0.1, 1.0, 0.1, 1.0)
+ ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0)
+ position: Qt.vector3d(0, 300, 0)
+ shadowMapFar: 2000
+ shadowMapQuality: Light.ShadowMapQualityHigh
+ visible: true
+ castsShadow: true
+ brightness: 0.5
+ SequentialAnimation on z {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: 400
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+
+ PointLight {
+ id: light3b
+ color: Qt.rgba(0.1, 1.0, 0.1, 1.0)
+ ambientColor: Qt.rgba(0.1, 0.1, 0.1, 1.0)
+ position: Qt.vector3d(0, 300, 0)
+ shadowMapFar: 2000
+ shadowMapQuality: Light.ShadowMapQualityHigh
+ visible: true
+ castsShadow: true
+ brightness: 0.5
+ SequentialAnimation on z {
+ loops: Animation.Infinite
+ NumberAnimation {
+ to: -400
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
+ to: 0
+ duration: 2000
+ easing.type: Easing.InOutQuad
+ }
+ }
+ }
+ SpotLight {
+ id: light4
+ color: Qt.rgba(1.0, 0.9, 0.7, 1.0)
+ ambientColor: Qt.rgba(0.0, 0.0, 0.0, 0.0)
+ position: Qt.vector3d(0, 250, 0)
+ eulerRotation.x: -45
+ shadowMapFar: 2000
+ shadowMapQuality: Light.ShadowMapQualityHigh
+ visible: true
+ castsShadow: true
+ brightness: 0.5
+ coneAngle: 50
+ innerConeAngle: 30
+ PropertyAnimation on eulerRotation.y {
+ loops: Animation.Infinite
+ from: 0
+ to: -360
+ duration: 10000
+ }
+ }
+
+ Model {
+ source: "#Rectangle"
+ y: -200
+ scale: Qt.vector3d(15, 15, 15)
+ eulerRotation.x: -90
+ materials: [
+ DefaultMaterial {
+ diffuseColor: Qt.rgba(0.8, 0.6, 0.4, 1.0)
+ }
+ ]
+ }
+ Model {
+ source: "#Rectangle"
+ z: -400
+ scale: Qt.vector3d(15, 15, 15)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: Qt.rgba(0.8, 0.8, 0.9, 1.0)
+ }
+ ]
+ }
+
+ Model {
+ source: "#Sphere"
+ scale: Qt.vector3d(3, 3, 3)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: Qt.rgba(0.9, 0.9, 0.9, 1.0)
+ }
+ ]
+ }
+
+ Model {
+ source: "#Cube"
+ position: light1.position
+ rotation: light1.rotation
+ property real size: 0.2
+ scale: Qt.vector3d(size, size, size)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: light1.color
+ opacity: 0.4
+ }
+ ]
+ }
+ Model {
+ source: "#Cube"
+ position: light2.position
+ rotation: light2.rotation
+ property real size: 0.2
+ scale: Qt.vector3d(size, size, size)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: light2.color
+ opacity: 0.4
+ }
+ ]
+ }
+ Model {
+ source: "#Cube"
+ position: light3.position
+ rotation: light3.rotation
+ property real size: 0.2
+ scale: Qt.vector3d(size, size, size)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: light3.color
+ opacity: 0.4
+ }
+ ]
+ }
+ Model {
+ source: "#Cube"
+ position: light2b.position
+ rotation: light2b.rotation
+ property real size: 0.2
+ scale: Qt.vector3d(size, size, size)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: light2b.color
+ opacity: 0.4
+ }
+ ]
+ }
+ Model {
+ source: "#Cube"
+ position: light3b.position
+ rotation: light3b.rotation
+ property real size: 0.2
+ scale: Qt.vector3d(size, size, size)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: light3b.color
+ opacity: 0.4
+ }
+ ]
+ }
+ Model {
+ source: "#Cube"
+ position: light4.position
+ rotation: light4.rotation
+ property real size: 0.2
+ scale: Qt.vector3d(size, size, size)
+ materials: [
+ DefaultMaterial {
+ diffuseColor: light4.color
+ opacity: 0.4
+ }
+ ]
+ }
+ }
+}
diff --git a/src/benchmarks/auto/quick3d/multiview.qml b/src/benchmarks/auto/quick3d/multiview.qml
new file mode 100644
index 0000000..5b1077b
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/multiview.qml
@@ -0,0 +1,213 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick3D
+import QmlBench
+
+CreationBenchmark {
+ id: root
+ count: 25*25
+ staticCount: 25*25
+
+ width: 800
+ height: 600
+ visible: true
+
+ // The root scene
+ Node {
+ id: standAloneScene
+ DirectionalLight {
+ ambientColor: Qt.rgba(0.5, 0.5, 0.5, 1.0)
+ brightness: 1.0
+ eulerRotation.x: -25
+ }
+
+ Model {
+ source: "#Cube"
+ y: -104
+ scale: Qt.vector3d(3, 3, 0.1)
+ eulerRotation.x: -90
+ materials: [
+ DefaultMaterial {
+ diffuseColor: Qt.rgba(0.8, 0.8, 0.8, 1.0)
+ }
+ ]
+ }
+
+ Model {
+ source: "#Sphere"
+ scale: Qt.vector3d(1, 1, 1)
+ materials: [
+ PrincipledMaterial {
+ baseColor: "#41cd52"
+ metalness: 0.0
+ roughness: 0.1
+ opacity: 1.0
+ }
+ ]
+ PropertyAnimation on eulerRotation.y {
+ loops: Animation.Infinite
+ duration: 5000
+ to: 0
+ from: -360
+ }
+ }
+
+ // The predefined cameras. They have to be part of the scene, i.e. inside the root node.
+ // Animated perspective camera
+ Node {
+ PerspectiveCamera {
+ id: cam1
+ z: 600
+ }
+ PropertyAnimation on eulerRotation.x {
+ loops: Animation.Infinite
+ duration: 5000
+ to: -360
+ from: 0
+ }
+ }
+
+ // Stationary perspective camera
+ PerspectiveCamera {
+ id: cam2
+ z: 600
+ }
+
+ // Second animated perspective camera
+ Node {
+ PerspectiveCamera {
+ id: cam3
+ x: 500
+ eulerRotation.y: 90
+ }
+ PropertyAnimation on eulerRotation.y {
+ loops: Animation.Infinite
+ duration: 5000
+ to: 0
+ from: -360
+ }
+ }
+
+ PerspectiveCamera {
+ id: cam4
+ y: 600
+ eulerRotation.x: -90
+ }
+
+ PerspectiveCamera {
+ id: cam5
+ x: -600
+ eulerRotation.y: -90
+ }
+
+ Node {
+ id: shapeSpawner
+ property var instances: []
+ property int count
+
+ function addShapes()
+ {
+ let rows = Math.ceil(Math.sqrt(count));
+ let strideX = root.width/rows;
+ let strideY = root.height/rows;
+ let cameraNames = ["cam1", "cam2", "cam3", "cam4", "cam5"]
+ var numAdded = 0;
+
+ for (var i = 0; i < rows; i++) {
+ for (var j = 0; j < rows; j++) {
+ if (numAdded == count)
+ break;
+
+ let xPos = i * strideX;
+ let yPos = j * strideY;
+
+ let idx = numAdded % 5;
+ let cameraName = cameraNames[idx];
+
+ var qmlStr =
+ [" import QtQuick ",
+ " import QtQuick3D ",
+ " ",
+ " Rectangle { ",
+ " width: " + strideX,
+ " height: " + strideY,
+ " x: " + xPos,
+ " y: " + yPos,
+ " color: \"#848895\" ",
+ " View3D { ",
+ " anchors.fill: parent ",
+ " importScene: standAloneScene ",
+ " camera: " + cameraName,
+ " } ",
+ " } "].join('\n');
+
+ var instance = Qt.createQmlObject(qmlStr, root, "View3D_" + idx);
+
+ instances.push(instance);
+ numAdded += 1;
+ }
+ }
+ }
+
+ function removeShapes()
+ {
+ for (var i = 0; i < instances.length; i++) {
+ instances[i].destroy();
+ }
+ instances = [];
+ }
+
+ Connections {
+ target: root
+ function onCountChanged() {
+ shapeSpawner.count = root.count;
+ shapeSpawner.removeShapes();
+ shapeSpawner.addShapes();
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ shapeSpawner.count = count;
+ shapeSpawner.addShapes();
+ }
+ }
+}
diff --git a/src/benchmarks/auto/quick3d/principledmaterial/PrincipledMaterial.qml b/src/benchmarks/auto/quick3d/principledmaterial/PrincipledMaterial.qml
new file mode 100644
index 0000000..205b3b1
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/principledmaterial/PrincipledMaterial.qml
@@ -0,0 +1,158 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick.Window
+import QtQuick3D
+import QmlBench
+
+
+Benchmark {
+ id: root;
+ count: 1; // Unused
+ staticCount: 1; // Unused
+
+ width: 1280
+ height: 720
+
+ property real metalness: 1.0
+ property real roughness: 0.2
+ property real specular: 0.0
+ property real specularTint: 0.0
+ property real opacityValue: 1.0
+
+ View3D {
+ anchors.fill: parent
+ camera: camera
+ renderMode: View3D.Underlay
+
+ //! [rotating light]
+ // Rotate the light direction
+ DirectionalLight {
+ eulerRotation.y: -100
+ SequentialAnimation on eulerRotation.y {
+ loops: Animation.Infinite
+ PropertyAnimation {
+ duration: 5000
+ to: 360
+ from: 0
+ }
+ }
+ }
+ //! [rotating light]
+
+ //! [environment]
+ environment: SceneEnvironment {
+ probeExposure: 2.5
+ clearColor: "#848895"
+
+ backgroundMode: SceneEnvironment.SkyBox
+ lightProbe: Texture {
+ source: "maps/OpenfootageNET_garage-1024.hdr"
+ }
+ }
+ //! [environment]
+
+ PerspectiveCamera {
+ id: camera
+ position: Qt.vector3d(0, 0, 600)
+ }
+
+ //! [basic principled]
+ Model {
+ position: Qt.vector3d(-250, -30, 0)
+ scale: Qt.vector3d(4, 4, 4)
+ source: "#Sphere"
+ materials: [ PrincipledMaterial {
+ baseColor: "#41cd52"
+ metalness: root.metalness
+ roughness: root.roughness
+ specularAmount: root.specular
+ specularTint: root.specularTint
+ opacity: root.opacityValue
+ }
+ ]
+ }
+ //! [basic principled]
+
+ //! [textured principled]
+ Model {
+ position: Qt.vector3d(250, -30, 0)
+ scale: Qt.vector3d(4, 4, 4)
+ source: "#Sphere"
+ materials: [ PrincipledMaterial {
+ metalness: root.metalness
+ roughness: root.roughness
+ specularAmount: root.specular
+ opacity: root.opacityValue
+
+ baseColorMap: Texture { source: "maps/metallic/basecolor.jpg" }
+ metalnessMap: Texture { source: "maps/metallic/metallic.jpg" }
+ roughnessMap: Texture { source: "maps/metallic/roughness.jpg" }
+ normalMap: Texture { source: "maps/metallic/normal.jpg" }
+
+ metalnessChannel: Material.R
+ roughnessChannel: Material.R
+ }
+ ]
+
+ //! [textured principled]
+
+ SequentialAnimation on eulerRotation {
+ loops: Animation.Infinite
+ PropertyAnimation {
+ duration: 5000
+ from: Qt.vector3d(0, 0, 0)
+ to: Qt.vector3d(360, 360, 360)
+ }
+ }
+ }
+ }
+}
diff --git a/src/benchmarks/auto/quick3d/principledmaterial/maps/OpenfootageNET_garage-1024.hdr b/src/benchmarks/auto/quick3d/principledmaterial/maps/OpenfootageNET_garage-1024.hdr
new file mode 100644
index 0000000..01e9e38
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/principledmaterial/maps/OpenfootageNET_garage-1024.hdr
Binary files differ
diff --git a/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/basecolor.jpg b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/basecolor.jpg
new file mode 100644
index 0000000..4401827
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/basecolor.jpg
Binary files differ
diff --git a/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/metallic.jpg b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/metallic.jpg
new file mode 100644
index 0000000..6fe7b17
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/metallic.jpg
Binary files differ
diff --git a/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/normal.jpg b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/normal.jpg
new file mode 100644
index 0000000..c8d1a59
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/normal.jpg
Binary files differ
diff --git a/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/roughness.jpg b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/roughness.jpg
new file mode 100644
index 0000000..f200e33
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/principledmaterial/maps/metallic/roughness.jpg
Binary files differ
diff --git a/src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml b/src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml
new file mode 100644
index 0000000..9bd820b
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/shapespawner/WeirdShape.qml
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2019 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** BSD License Usage
+** Alternatively, you may use this file under the terms of the BSD license
+** as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+** * Redistributions of source code must retain the above copyright
+** notice, this list of conditions and the following disclaimer.
+** * Redistributions in binary form must reproduce the above copyright
+** notice, this list of conditions and the following disclaimer in
+** the documentation and/or other materials provided with the
+** distribution.
+** * Neither the name of The Qt Company Ltd nor the names of its
+** contributors may be used to endorse or promote products derived
+** from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick3D
+
+Node {
+ id: weirdShape
+
+ property real xRotation: Math.random() * (360 - (-360)) + -360
+ property real yRotation: Math.random() * (360 - (-360)) + -360
+ property real zRotation: Math.random() * (360 - (-360)) + -360
+
+ property real hue: Math.random()
+
+ Model {
+ source: "weirdShape.mesh"
+ scale: Qt.vector3d(150, 150, 150)
+ eulerRotation.x: 90
+
+ SequentialAnimation on eulerRotation {
+ loops: Animation.Infinite
+ PropertyAnimation {
+ duration: Math.random() * (10000 - 1000) + 1000
+ to: Qt.vector3d(xRotation - 360, yRotation - 360, zRotation - 360)
+ from: Qt.vector3d(xRotation, yRotation, zRotation)
+ }
+ }
+
+ materials: [ DefaultMaterial { diffuseColor: Qt.hsva(hue, 1.0, 1.0, 1.0) } ]
+ }
+}
diff --git a/src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml b/src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml
new file mode 100644
index 0000000..c3a9e05
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/shapespawner/shapespawner.qml
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2021 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the test suite of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+import QtQuick
+import QtQuick3D
+import QmlBench
+
+CreationBenchmark {
+ id: root;
+ count: 4000;
+ staticCount: 4000;
+
+ View3D {
+ id: view
+ anchors.fill: parent
+
+ environment: SceneEnvironment {
+ clearColor: "skyblue"
+ backgroundMode: SceneEnvironment.Color
+ }
+
+ PerspectiveCamera {
+ position: Qt.vector3d(0, 200, 300)
+ eulerRotation.x: -30
+ }
+
+ DirectionalLight {
+ eulerRotation.x: -30
+ eulerRotation.y: -70
+ }
+
+ Node {
+ id: shapeSpawner
+ property real range: 300
+ property var instances: []
+ property int count
+
+ function addShapes()
+ {
+ for (var i = 0; i < count; i++) {
+ var xPos = (2 * Math.random() * range) - range;
+ var yPos = (2 * Math.random() * range) - range;
+ var zPos = (2 * Math.random() * range) - range;
+ var shapeComponent = Qt.createComponent("WeirdShape.qml");
+ let instance = shapeComponent.createObject(shapeSpawner,
+ { "x": xPos, "y": yPos, "z": zPos, "scale": Qt.vector3d(0.05, 0.05, 0.05)});
+ instances.push(instance);
+ }
+ }
+
+ function removeShapes()
+ {
+ for (var i = 0; i < instances.length; i++) {
+ instances[i].destroy();
+ }
+ instances = [];
+ }
+
+ Connections {
+ target: root
+ function onCountChanged() {
+ shapeSpawner.count = root.count;
+ shapeSpawner.removeShapes();
+ shapeSpawner.addShapes();
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ shapeSpawner.count = count;
+ shapeSpawner.addShapes();
+ }
+ }
+}
diff --git a/src/benchmarks/auto/quick3d/shapespawner/weirdShape.mesh b/src/benchmarks/auto/quick3d/shapespawner/weirdShape.mesh
new file mode 100644
index 0000000..2e4d6fa
--- /dev/null
+++ b/src/benchmarks/auto/quick3d/shapespawner/weirdShape.mesh
Binary files differ