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

Qt Quick Compiler fails to compile array

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.8.2
    • QML: Compiler
    • None
    • Windows

    Description

      https://www.qt.io/blog/compiling-qml-to-c-a-4x-speedup

      Attempting to recreate this program in 6.8.2 on windows renders the following errors:

      C:\Users\dadehnel\Downloads\CompilerEval\Categorizer.qml:24: warning: Could not compile binding for numbers: Cannot generate efficient code for storing an array in a non-sequence type [compiler]

      Categorizer.qml:39: warning: Could not compile function sum: Cannot generate efficient code for LoadElement on a sequence potentially affected by side effects [compiler]

      Categorizer.qml:59: warning: Could not compile binding for onCompleted: Cannot generate efficient code for LoadElement on a sequence potentially affected by side effects [compiler]

      Due to this the performance gains referenced in the blog post are not seen. Did something change with the compiler between 6.5 and 6.8? Is this expected behavior? I believe specifically the line referring to
              var result = [];
      Is what is causing the issue

      Attachments

        Issue Links

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

          Activity

            People

              qtqmlteam Qt Qml Team User
              dandehnel Daniel Dehnel
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes