From 0f68ffdd206487bec3bf675e673a0b817a9a3951 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 11 May 2017 10:17:10 +0200 Subject: Add creation benchmarks for Qt Quick Controls 2 Change-Id: I07e675ff8acf7741e8a299b28f170624fccbdf13 Reviewed-by: Eskil Abrahamsen Blomfeldt Reviewed-by: Robin Burchell --- .../creation/controls/delegates_buttoncontrol2.qml | 15 -------------- .../creation/controls/delegates_labelcontrol2.qml | 15 -------------- .../quick.controls2/delegates_busyindicator.qml | 15 ++++++++++++++ .../creation/quick.controls2/delegates_button.qml | 16 +++++++++++++++ .../quick.controls2/delegates_checkbox.qml | 16 +++++++++++++++ .../quick.controls2/delegates_combobox.qml | 16 +++++++++++++++ .../creation/quick.controls2/delegates_dial.qml | 15 ++++++++++++++ .../quick.controls2/delegates_itemdelegate.qml | 16 +++++++++++++++ .../creation/quick.controls2/delegates_label.qml | 15 ++++++++++++++ .../quick.controls2/delegates_menuitem.qml | 18 ++++++++++++++++ .../quick.controls2/delegates_progressbar.qml | 15 ++++++++++++++ .../quick.controls2/delegates_radiobutton.qml | 17 +++++++++++++++ .../quick.controls2/delegates_scrollbar.qml | 18 ++++++++++++++++ .../quick.controls2/delegates_scrollview.qml | 24 ++++++++++++++++++++++ .../creation/quick.controls2/delegates_slider.qml | 15 ++++++++++++++ .../creation/quick.controls2/delegates_spinbox.qml | 15 ++++++++++++++ .../creation/quick.controls2/delegates_switch.qml | 16 +++++++++++++++ .../creation/quick.controls2/delegates_tabbar.qml | 24 ++++++++++++++++++++++ .../quick.controls2/delegates_textarea.qml | 15 ++++++++++++++ .../quick.controls2/delegates_textfield.qml | 15 ++++++++++++++ .../creation/quick.controls2/delegates_tumbler.qml | 16 +++++++++++++++ 21 files changed, 317 insertions(+), 30 deletions(-) delete mode 100644 benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml delete mode 100644 benchmarks/auto/creation/controls/delegates_labelcontrol2.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_button.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_combobox.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_dial.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_label.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_slider.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_switch.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_textarea.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_textfield.qml create mode 100644 benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml diff --git a/benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml b/benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml deleted file mode 100644 index c1c5f71..0000000 --- a/benchmarks/auto/creation/controls/delegates_buttoncontrol2.qml +++ /dev/null @@ -1,15 +0,0 @@ -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: Math.random() * root.width - width - y: Math.random() * root.height - height - text: "Item #" + index; - } -} diff --git a/benchmarks/auto/creation/controls/delegates_labelcontrol2.qml b/benchmarks/auto/creation/controls/delegates_labelcontrol2.qml deleted file mode 100644 index befd4f1..0000000 --- a/benchmarks/auto/creation/controls/delegates_labelcontrol2.qml +++ /dev/null @@ -1,15 +0,0 @@ -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: Math.random() * root.width - width - y: Math.random() * root.height - height - text: "Qt Quick!" - } -} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml b/benchmarks/auto/creation/quick.controls2/delegates_busyindicator.qml new file mode 100644 index 0000000..a554255 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + running: index % 2 + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_button.qml b/benchmarks/auto/creation/quick.controls2/delegates_button.qml new file mode 100644 index 0000000..de4bbba --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "Button" + down: index % 2 + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml b/benchmarks/auto/creation/quick.controls2/delegates_checkbox.qml new file mode 100644 index 0000000..e5474d6 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "CheckBox" + checked: index % 2 + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml b/benchmarks/auto/creation/quick.controls2/delegates_combobox.qml new file mode 100644 index 0000000..2d39e78 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + model: 5 + currentIndex: index % count + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_dial.qml b/benchmarks/auto/creation/quick.controls2/delegates_dial.qml new file mode 100644 index 0000000..1699c32 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + value: index / root.staticCount + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml b/benchmarks/auto/creation/quick.controls2/delegates_itemdelegate.qml new file mode 100644 index 0000000..ccd89ab --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "ItemDelegate" + down: index % 2 + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_label.qml b/benchmarks/auto/creation/quick.controls2/delegates_label.qml new file mode 100644 index 0000000..84a4b05 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "Qt Quick!" + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml b/benchmarks/auto/creation/quick.controls2/delegates_menuitem.qml new file mode 100644 index 0000000..30ea4d7 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "MenuItem" + checkable: index % 2 + checked: index % 2 + down: index % 3 + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml b/benchmarks/auto/creation/quick.controls2/delegates_progressbar.qml new file mode 100644 index 0000000..6b87685 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + value: index / root.staticCount + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml b/benchmarks/auto/creation/quick.controls2/delegates_radiobutton.qml new file mode 100644 index 0000000..6efe020 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "CheckBox" + autoExclusive: false + checked: index % 2 + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml b/benchmarks/auto/creation/quick.controls2/delegates_scrollbar.qml new file mode 100644 index 0000000..a2c9858 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + height: 100 + size: index / root.staticCount + pressed: index % 2 + active: true + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml b/benchmarks/auto/creation/quick.controls2/delegates_scrollview.qml new file mode 100644 index 0000000..b80066b --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * 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/benchmarks/auto/creation/quick.controls2/delegates_slider.qml b/benchmarks/auto/creation/quick.controls2/delegates_slider.qml new file mode 100644 index 0000000..70c1485 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + value: index / root.staticCount + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml b/benchmarks/auto/creation/quick.controls2/delegates_spinbox.qml new file mode 100644 index 0000000..3f197e8 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + value: index / root.staticCount * to + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_switch.qml b/benchmarks/auto/creation/quick.controls2/delegates_switch.qml new file mode 100644 index 0000000..059e932 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "Switch" + checked: index % 2 + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml b/benchmarks/auto/creation/quick.controls2/delegates_tabbar.qml new file mode 100644 index 0000000..ecfd80c --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + currentIndex: index / root.staticCount * count + TabButton { + text: "Tab1" + } + TabButton { + text: "Tab2" + } + TabButton { + text: "Tab3" + } + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml b/benchmarks/auto/creation/quick.controls2/delegates_textarea.qml new file mode 100644 index 0000000..09ade83 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "Text\nArea" + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml b/benchmarks/auto/creation/quick.controls2/delegates_textfield.qml new file mode 100644 index 0000000..2b688c1 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + text: "TextField" + } +} diff --git a/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml b/benchmarks/auto/creation/quick.controls2/delegates_tumbler.qml new file mode 100644 index 0000000..4ca3595 --- /dev/null +++ b/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: Math.random() * root.width - width + y: Math.random() * root.height - height + model: 5 + currentIndex: index % count + } +} -- cgit v1.2.3