diff options
Diffstat (limited to 'src/benchmarks/auto/creation/quick/delegates_qobject.qml')
-rw-r--r-- | src/benchmarks/auto/creation/quick/delegates_qobject.qml | 27 |
1 files changed, 27 insertions, 0 deletions
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(); + } + } +} |