diff options
Diffstat (limited to 'tests/benchmarks/qml/librarymetrics_performance/data')
72 files changed, 1715 insertions, 0 deletions
diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/absolutepositioning.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/absolutepositioning.2.qml new file mode 100644 index 0000000000..479e94c38a --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/absolutepositioning.2.qml @@ -0,0 +1,126 @@ +import QtQuick 2.0 + +// positioning all elements manually. +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: 400 + height: 400 + y: 400 + + Rectangle { + id: n1 + color: "green" + width: 200 + height: 100 + x: 0 + y: 200 + } + + Rectangle { + id: n2 + color: "cyan" + width: 200 + height: 100 + x: 200 + y: 200 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: 200 + height: 100 + x: 0 + y: 300 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: 200 + height: 100 + x: 200 + y: 300 + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // // expand + // p.height = 800 + // c.height = 400 + // c.y = 400 + // n1.height = 100 + // n1.y = 200 + // n2.height = 100 + // n2.y = 200 + // n3.height = 100 + // n3.y = 300 + // n4.height = 100 + // n4.y = 300 + // } else { + // count = 0; + // // shrink + // p.height = 400 + // c.height = 200 + // c.y = 200 + // n1.height = 50 + // n1.y = 100 + // n2.height = 50 + // n2.y = 100 + // n3.height = 50 + // n3.y = 150 + // n4.height = 50 + // n4.y = 150 + // } + // } + //} + + Component.onCompleted: { + var iterations = 10000; + //var t0 = new Date(); + while (iterations > 0) { + iterations--; + // expand + p.height = 800 + c.height = 400 + c.y = 400 + n1.height = 100 + n1.y = 200 + n2.height = 100 + n2.y = 200 + n3.height = 100 + n3.y = 300 + n4.height = 100 + n4.y = 300 + // shrink + p.height = 400 + c.height = 200 + c.y = 200 + n1.height = 50 + n1.y = 100 + n2.height = 50 + n2.y = 100 + n3.height = 50 + n3.y = 150 + n4.height = 50 + n4.y = 150 + } + //var t1 = new Date(); + //console.log("Absolute Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/absolutepositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/absolutepositioning.qml new file mode 100644 index 0000000000..9dac3a5fd0 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/absolutepositioning.qml @@ -0,0 +1,119 @@ +import QtQuick 2.0 + +// positioning all elements manually. +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: 400 + height: 400 + y: 400 + + Rectangle { + id: n1 + color: "green" + width: 200 + height: 100 + x: 0 + y: 200 + } + + Rectangle { + id: n2 + color: "cyan" + width: 200 + height: 100 + x: 200 + y: 200 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: 200 + height: 100 + x: 0 + y: 300 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: 200 + height: 100 + x: 200 + y: 300 + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // // expand + // p.height = 800 + // c.height = 400 + // c.y = 400 + // n1.height = 100 + // n1.y = 200 + // n2.height = 100 + // n2.y = 200 + // n3.height = 100 + // n3.y = 300 + // n4.height = 100 + // n4.y = 300 + // } else { + // count = 0; + // // shrink + // p.height = 400 + // c.height = 200 + // c.y = 200 + // n1.height = 50 + // n1.y = 100 + // n2.height = 50 + // n2.y = 100 + // n3.height = 50 + // n3.y = 150 + // n4.height = 50 + // n4.y = 150 + // } + // } + //} + + Component.onCompleted: { + // expand + p.height = 800 + c.height = 400 + c.y = 400 + n1.height = 100 + n1.y = 200 + n2.height = 100 + n2.y = 200 + n3.height = 100 + n3.y = 300 + n4.height = 100 + n4.y = 300 + // shrink + p.height = 400 + c.height = 200 + c.y = 200 + n1.height = 50 + n1.y = 100 + n2.height = 50 + n2.y = 100 + n3.height = 50 + n3.y = 150 + n4.height = 50 + n4.y = 150 + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/anchoredpositioning.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/anchoredpositioning.2.qml new file mode 100644 index 0000000000..592b37dfc7 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/anchoredpositioning.2.qml @@ -0,0 +1,91 @@ +import QtQuick 2.0 + +// positioning via anchors +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + anchors.top: p.verticalCenter + anchors.bottom: p.bottom + anchors.left: p.left + anchors.right: p.right + + Rectangle { + id: g + anchors.top: c.verticalCenter + anchors.bottom: c.bottom + anchors.left: c.left + anchors.right: c.right + + Rectangle { + id: n1 + color: "green" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n2 + color: "cyan" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.horizontalCenter + anchors.right: g.right + } + + Rectangle { + id: n3 + color: "aquamarine" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n4 + color: "lightgreen" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.horizontalCenter + anchors.right: g.right + } + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + var iterations = 10000; + //var t0 = new Date(); + while (iterations > 0) { + iterations--; + p.height = 800; + p.height = 400; + } + //var t1 = new Date(); + //console.log("Anchored Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/anchoredpositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/anchoredpositioning.qml new file mode 100644 index 0000000000..36227ac962 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/anchoredpositioning.qml @@ -0,0 +1,84 @@ +import QtQuick 2.0 + +// positioning via anchors +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + anchors.top: p.verticalCenter + anchors.bottom: p.bottom + anchors.left: p.left + anchors.right: p.right + + Rectangle { + id: g + anchors.top: c.verticalCenter + anchors.bottom: c.bottom + anchors.left: c.left + anchors.right: c.right + + Rectangle { + id: n1 + color: "green" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n2 + color: "cyan" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.horizontalCenter + anchors.right: g.right + } + + Rectangle { + id: n3 + color: "aquamarine" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n4 + color: "lightgreen" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.horizontalCenter + anchors.right: g.right + } + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + p.height = 800; + p.height = 400; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithbindingpositioning.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithbindingpositioning.2.qml new file mode 100644 index 0000000000..33483ca9e5 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithbindingpositioning.2.qml @@ -0,0 +1,83 @@ +import QtQuick 2.0 + +// positioning via anchors contaminated with a binding +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + anchors.top: p.verticalCenter + anchors.bottom: p.bottom + anchors.left: p.left + anchors.right: p.right + + Rectangle { + id: n1 + color: "green" + height: c.height / 4 + anchors.top: c.verticalCenter + anchors.left: c.left + anchors.right: c.horizontalCenter + } + + Rectangle { + id: n2 + color: "cyan" + anchors.top: c.verticalCenter + anchors.bottom: n1.bottom + anchors.left: c.horizontalCenter + anchors.right: c.right + } + + Rectangle { + id: n3 + color: "aquamarine" + anchors.top: n1.bottom + anchors.bottom: c.bottom + anchors.left: c.left + anchors.right: c.horizontalCenter + } + + Rectangle { + id: n4 + color: "lightgreen" + anchors.top: n1.bottom + anchors.bottom: c.bottom + anchors.left: c.horizontalCenter + anchors.right: c.right + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + var iterations = 10000; + //var t0 = new Date(); + while (iterations > 0) { + iterations--; + p.height = 800; + p.height = 400; + } + //var t1 = new Date(); + //console.log("Anchor With Binding Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithbindingpositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithbindingpositioning.qml new file mode 100644 index 0000000000..d05a089a81 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithbindingpositioning.qml @@ -0,0 +1,76 @@ +import QtQuick 2.0 + +// positioning via anchors contaminated with a binding +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + anchors.top: p.verticalCenter + anchors.bottom: p.bottom + anchors.left: p.left + anchors.right: p.right + + Rectangle { + id: n1 + color: "green" + height: c.height / 4 + anchors.top: c.verticalCenter + anchors.left: c.left + anchors.right: c.horizontalCenter + } + + Rectangle { + id: n2 + color: "cyan" + anchors.top: c.verticalCenter + anchors.bottom: n1.bottom + anchors.left: c.horizontalCenter + anchors.right: c.right + } + + Rectangle { + id: n3 + color: "aquamarine" + anchors.top: n1.bottom + anchors.bottom: c.bottom + anchors.left: c.left + anchors.right: c.horizontalCenter + } + + Rectangle { + id: n4 + color: "lightgreen" + anchors.top: n1.bottom + anchors.bottom: c.bottom + anchors.left: c.horizontalCenter + anchors.right: c.right + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + p.height = 800; + p.height = 400; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithgridpositioning.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithgridpositioning.2.qml new file mode 100644 index 0000000000..7c0d868e82 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithgridpositioning.2.qml @@ -0,0 +1,93 @@ +import QtQuick 2.0 + +// positioning via anchors with a grid +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + anchors.top: p.verticalCenter + anchors.bottom: p.bottom + anchors.left: p.left + anchors.right: p.right + + Grid { + id: g + rows: 2 + columns: 2 + anchors.top: c.verticalCenter + anchors.bottom: c.bottom + anchors.left: c.left + anchors.right: c.right + + Rectangle { + id: n1 + color: "green" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n2 + color: "cyan" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.horizontalCenter + anchors.right: g.right + } + + Rectangle { + id: n3 + color: "aquamarine" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n4 + color: "lightgreen" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.horizontalCenter + anchors.right: g.right + } + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + var iterations = 10000; + //var t0 = new Date(); + while (iterations > 0) { + iterations--; + p.height = 800; + p.height = 400; + } + //var t1 = new Date(); + //console.log("Anchor With Grid Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithgridpositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithgridpositioning.qml new file mode 100644 index 0000000000..bc98d95e87 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/anchorwithgridpositioning.qml @@ -0,0 +1,86 @@ +import QtQuick 2.0 + +// positioning via anchors with a grid +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + anchors.top: p.verticalCenter + anchors.bottom: p.bottom + anchors.left: p.left + anchors.right: p.right + + Grid { + id: g + rows: 2 + columns: 2 + anchors.top: c.verticalCenter + anchors.bottom: c.bottom + anchors.left: c.left + anchors.right: c.right + + Rectangle { + id: n1 + color: "green" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n2 + color: "cyan" + anchors.top: g.top + anchors.bottom: g.verticalCenter + anchors.left: g.horizontalCenter + anchors.right: g.right + } + + Rectangle { + id: n3 + color: "aquamarine" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.left + anchors.right: g.horizontalCenter + } + + Rectangle { + id: n4 + color: "lightgreen" + anchors.top: g.verticalCenter + anchors.bottom: g.bottom + anchors.left: g.horizontalCenter + anchors.right: g.right + } + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + p.height = 800; + p.height = 400; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/animations.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/animations.1.qml new file mode 100644 index 0000000000..846378fdee --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/animations.1.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Item { + property real a: 50 + NumberAnimation on a { to: 500; duration: 1000 } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/animations.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/animations.2.qml new file mode 100644 index 0000000000..9bba3a3091 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/animations.2.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +Item { + id: root + property real a: 50 + SequentialAnimation { + id: anim + ScriptAction { script: root.a += 5; } + ScriptAction { script: root.a += 15; } + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/animations.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/animations.3.qml new file mode 100644 index 0000000000..b0c5b33cd7 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/animations.3.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +Item { + id: root + property real a: 50 + ParallelAnimation { + id: anim + ScriptAction { script: root.a += 5; } + ScriptAction { script: root.a += 15; } + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/animations.4.qml b/tests/benchmarks/qml/librarymetrics_performance/data/animations.4.qml new file mode 100644 index 0000000000..877cf4dd14 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/animations.4.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +Item { + id: root + property real a: 50 + SequentialAnimation { + id: anim + ScriptAction { script: root.a += 5; } + ScriptAction { script: root.a += 15; } + } + + Component.onCompleted: { + anim.start(); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/bindingpositioning.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/bindingpositioning.2.qml new file mode 100644 index 0000000000..5c16196f07 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/bindingpositioning.2.qml @@ -0,0 +1,82 @@ +import QtQuick 2.0 + +// positioning done with bindings +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: p.width + height: p.height / 2 + y: p.height / 2 + + Rectangle { + id: n1 + color: "green" + width: c.width / 2 + height: c.height / 4 + x: 0 + y: c.height / 2 + } + + Rectangle { + id: n2 + color: "cyan" + width: c.width / 2 + height: c.height / 4 + x: c.width / 2 + y: c.height / 2 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: c.width / 2 + height: c.height / 4 + x: 0 + y: (c.height / 4) * 3 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: c.width / 2 + height: c.height / 4 + x: c.width / 2 + y: (c.height / 4) * 3 + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + var iterations = 10000; + //var t0 = new Date(); + while (iterations > 0) { + iterations--; + p.height = 800; + p.height = 400; + } + //var t1 = new Date(); + //console.log("Binding Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/bindingpositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/bindingpositioning.qml new file mode 100644 index 0000000000..0c60d1e53b --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/bindingpositioning.qml @@ -0,0 +1,75 @@ +import QtQuick 2.0 + +// positioning done with bindings +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: p.width + height: p.height / 2 + y: p.height / 2 + + Rectangle { + id: n1 + color: "green" + width: c.width / 2 + height: c.height / 4 + x: 0 + y: c.height / 2 + } + + Rectangle { + id: n2 + color: "cyan" + width: c.width / 2 + height: c.height / 4 + x: c.width / 2 + y: c.height / 2 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: c.width / 2 + height: c.height / 4 + x: 0 + y: (c.height / 4) * 3 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: c.width / 2 + height: c.height / 4 + x: c.width / 2 + y: (c.height / 4) * 3 + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + p.height = 800; + p.height = 400; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.2.qml new file mode 100644 index 0000000000..1e39a4fbb2 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.2.qml @@ -0,0 +1,85 @@ +import QtQuick 2.0 + +// positioning via bindings with a grid +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: p.width + height: p.height / 2 + y: p.height / 2 + + Grid { + id: g + rows: 2 + columns: 2 + width: c.width + height: c.height / 2 + y: c.height / 2 + + Rectangle { + id: n1 + color: "green" + width: g.width/2 + height: g.height/2 + } + + Rectangle { + id: n2 + color: "cyan" + width: g.width/2 + height: g.height/2 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: g.width/2 + height: g.height/2 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: g.width/2 + height: g.height/2 + } + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + var iterations = 10000; + //var t0 = new Date(); + while (iterations > 0) { + iterations--; + // expand + p.height = 800; + // shrink + p.height = 400; + } + //var t1 = new Date(); + //console.log("Binding With Grid Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml new file mode 100644 index 0000000000..ef481ed55c --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/bindingwithgridpositioning.qml @@ -0,0 +1,76 @@ +import QtQuick 2.0 + +// positioning via bindings with a grid +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: p.width + height: p.height / 2 + y: p.height / 2 + + Grid { + id: g + rows: 2 + columns: 2 + width: c.width + height: c.height / 2 + y: c.height / 2 + + Rectangle { + id: n1 + color: "green" + width: g.width/2 + height: g.height/2 + } + + Rectangle { + id: n2 + color: "cyan" + width: g.width/2 + height: g.height/2 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: g.width/2 + height: g.height/2 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: g.width/2 + height: g.height/2 + } + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + p.height = 800; + p.height = 400; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/expression.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/expression.1.qml new file mode 100644 index 0000000000..f6eaf39675 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/expression.1.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +Item { + property int a: 0 + function someFunc() { + var tmp = 5; + var another = tmp * 5 + 3; + var yetanother = another % 5; + if (yetanother > 2) a = 42; + else a = 9000; + return 42; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/expression.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/expression.2.qml new file mode 100644 index 0000000000..6664156c4f --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/expression.2.qml @@ -0,0 +1,19 @@ +import QtQuick 2.0 + +Item { + property int a: 0 + property int b: 0 + + function someFunc() { + var tmp = 5; + var another = tmp * 5 + 3; + var yetanother = another % 5; + if (yetanother > 2) a = 42; + else a = 9000; + return 42; + } + + Component.onCompleted: { + b = someFunc(); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/expression.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/expression.3.qml new file mode 100644 index 0000000000..e6b5e934ea --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/expression.3.qml @@ -0,0 +1,14 @@ +import QtQuick 2.0 + +Item { + property int a: 5 + property int b: 0 + + function someFunc() { + b += a; + } + + Component.onCompleted: { + onAChanged.connect(someFunc) + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/expression.4.qml b/tests/benchmarks/qml/librarymetrics_performance/data/expression.4.qml new file mode 100644 index 0000000000..bcfc381c79 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/expression.4.qml @@ -0,0 +1,19 @@ +import QtQuick 2.0 + +Item { + property int a: 5 + property int d: 12 + signal trigger(int b, int c) + + onAChanged: { + trigger(a*2, 15+a) + } + + function someFunc(b, c) { + d = b+c; + } + + Component.onCompleted: { + trigger.connect(someFunc); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/flickable.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/flickable.1.qml new file mode 100644 index 0000000000..cbec44bb4f --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/flickable.1.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +Flickable { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/flickable.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/flickable.2.qml new file mode 100644 index 0000000000..2257680c34 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/flickable.2.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Flickable { + width: 320 + height: 480 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/flickable.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/flickable.3.qml new file mode 100644 index 0000000000..956103eef7 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/flickable.3.qml @@ -0,0 +1,15 @@ +import QtQuick 2.0 + +Flickable { + width: 320 + height: 480 + contentWidth: c1.width + contentHeight: c1.height + + Rectangle { + id: c1 + width: 500 + height: 1000 + color: "blue" + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/green.png b/tests/benchmarks/qml/librarymetrics_performance/data/green.png Binary files differnew file mode 100644 index 0000000000..0a2e153ba1 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/green.png diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/grid.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/grid.1.qml new file mode 100644 index 0000000000..d29d1fad19 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/grid.1.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +Grid { + columns: 3 + spacing: 2 + Rectangle { color: "red"; width: 50; height: 50 } + Rectangle { color: "green"; width: 20; height: 50 } + Rectangle { color: "blue"; width: 50; height: 20 } + Rectangle { color: "cyan"; width: 50; height: 50 } + Rectangle { color: "magenta"; width: 10; height: 10 } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/image.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/image.1.qml new file mode 100644 index 0000000000..9be39f8445 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/image.1.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +Image { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/image.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/image.2.qml new file mode 100644 index 0000000000..7581cf1970 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/image.2.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Image { + width: 320 + height: 480 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/image.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/image.3.qml new file mode 100644 index 0000000000..beede811ff --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/image.3.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Image { + width: 320 + height: 480 + source: "green.png" +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/image.4.qml b/tests/benchmarks/qml/librarymetrics_performance/data/image.4.qml new file mode 100644 index 0000000000..7031dca0bf --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/image.4.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Image { + width: 320 + height: 480 + source: "green.png" + asynchronous: true +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.1.qml new file mode 100644 index 0000000000..459c82afbb --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.1.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +Item { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.10.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.10.qml new file mode 100644 index 0000000000..5a50be2bf1 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.10.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property bool a: true +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.11.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.11.qml new file mode 100644 index 0000000000..1e2b6eab29 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.11.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property string a: "hello, world" +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.12.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.12.qml new file mode 100644 index 0000000000..f026c1f305 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.12.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property real a: 42.42 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.13.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.13.qml new file mode 100644 index 0000000000..6ca798ef66 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.13.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property variant a: Qt.rgba(0.3, 0.4, 0.5, 0.6) +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.14.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.14.qml new file mode 100644 index 0000000000..2f9a951409 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.14.qml @@ -0,0 +1,8 @@ +import QtQuick 2.0 + +Item { + Item { + id: c1 + } + property Item a: c1 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.15.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.15.qml new file mode 100644 index 0000000000..f18738955f --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.15.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property var a: 5 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.16.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.16.qml new file mode 100644 index 0000000000..b37ac77f05 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.16.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property var a: function() { return 6; } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.17.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.17.qml new file mode 100644 index 0000000000..ad0de266a3 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.17.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property var a: { "tag": "test" } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.18.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.18.qml new file mode 100644 index 0000000000..b77a760f6c --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.18.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Item { + property int a: b + c + property int b: 2 + property int c: 40 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.19.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.19.qml new file mode 100644 index 0000000000..66e77fdefb --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.19.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property int a: if (true) 5; +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.2.qml new file mode 100644 index 0000000000..c08c692c91 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.2.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property int a +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.20.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.20.qml new file mode 100644 index 0000000000..9b1bd56fe1 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.20.qml @@ -0,0 +1,12 @@ +import QtQuick 2.0 + +Item { + Item { + id: c1 + function someFunc() { return 42; } + property int b: someFunc() + } + property alias c1bAlias: c1.b + + property int a: c1bAlias * 5 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.21.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.21.qml new file mode 100644 index 0000000000..4a423fd1fd --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.21.qml @@ -0,0 +1,18 @@ +import QtQuick 2.0 + +Item { + id: root + objectName: "root" + function generate() { + var f = null; + if (root.objectName == "root") { + f = function(param) { return 42 - param; } + } else { + f = function(param) { return 9000 * param; } + } + return f; + } + + property int b: 50 + property var a: b + generate()() +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.22.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.22.qml new file mode 100644 index 0000000000..7cd408f660 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.22.qml @@ -0,0 +1,11 @@ +import QtQuick 2.0 + +Item { + property int b: 100 + property int c: 15 + property int a: 15 + onAChanged: { + if (b >= 100) b = 12; + else c += a; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.23.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.23.qml new file mode 100644 index 0000000000..837f137ce3 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.23.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 +import ModuleApi 1.0 as ModApi + +Item { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.24.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.24.qml new file mode 100644 index 0000000000..63a53dbe0d --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.24.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 +import ModuleApi 1.0 as ModApi + +Item { + property int a: ModApi.ModuleApi.intProp +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.25.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.25.qml new file mode 100644 index 0000000000..a690761c94 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.25.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 +import ModuleApi 1.0 as ModApi + +Item { + property int a: ModApi.ModuleApi.intFunc() +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.3.qml new file mode 100644 index 0000000000..b0c43b142d --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.3.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property bool a +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.4.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.4.qml new file mode 100644 index 0000000000..fb1586ce2f --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.4.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property string a +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.5.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.5.qml new file mode 100644 index 0000000000..c6030addfa --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.5.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property real a +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.6.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.6.qml new file mode 100644 index 0000000000..acc8d17ca0 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.6.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property variant a +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.7.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.7.qml new file mode 100644 index 0000000000..cf566e37e2 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.7.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property Item a +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.8.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.8.qml new file mode 100644 index 0000000000..449d6b3f01 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.8.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property var a +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/item.9.qml b/tests/benchmarks/qml/librarymetrics_performance/data/item.9.qml new file mode 100644 index 0000000000..7875097b04 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/item.9.qml @@ -0,0 +1,5 @@ +import QtQuick 2.0 + +Item { + property int a: 42 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/listview.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/listview.1.qml new file mode 100644 index 0000000000..617f66742f --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/listview.1.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +ListView { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/listview.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/listview.2.qml new file mode 100644 index 0000000000..095b026fd2 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/listview.2.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + ListView { + anchors.fill: parent + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/listview.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/listview.3.qml new file mode 100644 index 0000000000..9573adba1a --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/listview.3.qml @@ -0,0 +1,27 @@ +import QtQuick 2.0 + +Item { + width: 320 + height: 480 + + ListView { + anchors.fill: parent + model: simpleModel + delegate: Text { + text: name + } + } + + ListModel { + id: simpleModel + ListElement { + name: "first" + } + ListElement { + name: "second" + } + ListElement { + name: "third" + } + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.1.qml new file mode 100644 index 0000000000..71a522ea6c --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.1.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +MouseArea { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.2.qml new file mode 100644 index 0000000000..55c6be361a --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.2.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +MouseArea { + width: 320 + height: 480 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.3.qml new file mode 100644 index 0000000000..91b2718011 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/mousearea.3.qml @@ -0,0 +1,10 @@ +import QtQuick 2.0 + +MouseArea { + width: 320 + height: 480 + property int clickCount: 0 + onClicked: { + clickCount++; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/nopositioning.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/nopositioning.2.qml new file mode 100644 index 0000000000..2edda352ef --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/nopositioning.2.qml @@ -0,0 +1,73 @@ +import QtQuick 2.0 + +// no bindings or anchors. +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: 400 + height: 200 + + Rectangle { + id: n1 + color: "green" + width: 200 + height: 50 + } + + Rectangle { + id: n2 + color: "cyan" + width: 200 + height: 50 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: 200 + height: 50 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: 200 + height: 50 + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + var iterations = 10000; + //var t0 = new Date(); + while (iterations > 0) { + iterations--; + p.height = 800; + p.height = 400; + } + //var t1 = new Date(); + //console.log("No Positioning: " + (t1.valueOf() - t0.valueOf()) + " milliseconds"); + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/nopositioning.qml b/tests/benchmarks/qml/librarymetrics_performance/data/nopositioning.qml new file mode 100644 index 0000000000..2fda6ca437 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/nopositioning.qml @@ -0,0 +1,67 @@ +import QtQuick 2.0 + +// no bindings or anchors. +Rectangle { + id: p + color: "red" + width: 400 + height: 800 + + Rectangle { + id: c + color: "blue" + width: 400 + height: 200 + + Rectangle { + id: n1 + color: "green" + width: 200 + height: 50 + } + + Rectangle { + id: n2 + color: "cyan" + width: 200 + height: 50 + } + + Rectangle { + id: n3 + color: "aquamarine" + width: 200 + height: 50 + } + + Rectangle { + id: n4 + color: "lightgreen" + width: 200 + height: 50 + } + } + + // for visually determining correctness. + //Timer { + // property int count: 0 + // interval: 1000 + // running: true + // repeat: true + // onTriggered: { + // if (count == 0) { + // count = 1; + // p.height = 800; + // } else { + // count = 0; + // p.height = 400; + // } + // } + //} + + Component.onCompleted: { + // we trigger just two position updates. + p.height = 800; + p.height = 400; + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.1.qml new file mode 100644 index 0000000000..011702bbc8 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.1.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +Rectangle { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.2.qml new file mode 100644 index 0000000000..40cca530bb --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.2.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Rectangle { + width: 320 + height: 480 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.3.qml new file mode 100644 index 0000000000..19d702774d --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/rectangle.3.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Rectangle { + width: 320 + height: 480 + color: "red" +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/repeater.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/repeater.1.qml new file mode 100644 index 0000000000..9c935cf9a8 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/repeater.1.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +Row { + Repeater { + model: 3 + Rectangle { + width: 100 + height: 40 + border.width: 2 + color: "red" + } + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/repeater.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/repeater.2.qml new file mode 100644 index 0000000000..e413279e02 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/repeater.2.qml @@ -0,0 +1,13 @@ +import QtQuick 2.0 + +Column { + Repeater { + model: 3 + Rectangle { + width: 100 + height: 40 + border.width: 2 + color: "red" + } + } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/states.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/states.1.qml new file mode 100644 index 0000000000..9c5f038197 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/states.1.qml @@ -0,0 +1,24 @@ +import QtQuick 2.0 + +Item { + id: root + width: 320 + height: 480 + + property real a: 200 + property real b: 10 + + states: [ + State { + name: "first" + PropertyChanges { target: root; onBChanged: setA_1() } + }, + State { + name: "second" + PropertyChanges { target: root; onBChanged: setA_2() } + } + ] + + function setA_1() { a = 50; } + function setA_2() { a = 100; } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/states.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/states.2.qml new file mode 100644 index 0000000000..449d244058 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/states.2.qml @@ -0,0 +1,28 @@ +import QtQuick 2.0 + +Item { + id: root + width: 320 + height: 480 + + property real a: 200 + property real b: 10 + + states: [ + State { + name: "first" + PropertyChanges { target: root; onBChanged: setA_1() } + }, + State { + name: "second" + PropertyChanges { target: root; onBChanged: setA_2() } + } + ] + + transitions: Transition { + NumberAnimation { property: "a"; easing.type: Easing.InOutQuad } + } + + function setA_1() { a = 50; } + function setA_2() { a = 100; } +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/text.1.qml b/tests/benchmarks/qml/librarymetrics_performance/data/text.1.qml new file mode 100644 index 0000000000..d68e6e154b --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/text.1.qml @@ -0,0 +1,4 @@ +import QtQuick 2.0 + +Text { +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/text.2.qml b/tests/benchmarks/qml/librarymetrics_performance/data/text.2.qml new file mode 100644 index 0000000000..f77b9a9eea --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/text.2.qml @@ -0,0 +1,6 @@ +import QtQuick 2.0 + +Text { + width: 320 + height: 480 +} diff --git a/tests/benchmarks/qml/librarymetrics_performance/data/text.3.qml b/tests/benchmarks/qml/librarymetrics_performance/data/text.3.qml new file mode 100644 index 0000000000..8e15571687 --- /dev/null +++ b/tests/benchmarks/qml/librarymetrics_performance/data/text.3.qml @@ -0,0 +1,7 @@ +import QtQuick 2.0 + +Text { + width: 320 + height: 480 + text: "hello, world" +} |