Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-140816

QmlBench CreationBenchmark is somewhat broken

XMLWordPrintable

       

      import QtQuick 2.0
      import QmlBench 1.0
      
      // The base of all *creation* benchmarks.
      // A creation benchmark is something that attempts to create 'count' items, and
      // render 'count' items, as driven by the shell.
      Benchmark {
          property alias delegate: internalRepeater.delegate
          property alias repeater: internalRepeater
      
          // Whenever the frame tick happens, force the destruction and recreation of
          // all items.
          onTChanged: {
              internalRepeater.model = 0;
              internalRepeater.model = root.count
          }
      
          Component.onCompleted: internalRepeater.model = root.count
      
          // The thing that makes the magic happen.
          Repeater {
              id: internalRepeater
          }
      } 

      This is the code for CreationBenchmark.qml for QmlBench. It is used in conjunction with a delegate to benchmark the creation of large numbers of Items.

      As the comment above onTChanged suggests, the goal is to clear the model and destroy all its data and then recreate it again, over and over.

      This does not seem to work as intended, however. The memory usage of the test increases fast with the iterations and things slow down over time. Presumably, the items are never destroyed and something keeps iterating over them (maybe the GC).

      This also makes the --repeat option (which has a default value of 5) passed to qmlbench to obtain more stable results counterproductive as repeated runs of the test only ever decrease in performance. This leads to wrong numbers.

      I was not able to identify the source of this issue.

       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            qtqmlteam Qt Qml Team User
            olivier.decanniere Olivier De Cannière
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes