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

[Reg 6.5.0 -> 6.5.5] Compilation blog post example doesn't work anymore

XMLWordPrintable

    • c36360eb1 (6.9), 9bfcc36f2 (tqtc/lts-6.8), 9bc25cd53 (tqtc/lts-6.8), dfc56c205 (tqtc/lts-6.8), 564d2eb26 (tqtc/lts-6.8), b9974d82c (dev), 6bd483038 (6.10), 9383c7c05 (6.9), bc8ebb88d (tqtc/lts-6.8), f3a593235 (tqtc/lts-6.5), 81e8b11ad (tqtc/lts-6.5)

      The example from https://www.qt.io/blog/compiling-qml-to-c-a-4x-speedup doesn't compile to C++ anymore. You instead get:

      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]
      

      There's no obvious reason for this. The array shouldn't have to be stored in anything but list<double> and the numbers in sum() are not actually affected by any side effects.

      In onCompleted it probably assumes console.log() has side effects. We could deal with that by starting to mark specific functions as pure. However, onCompleted is not the hot code path here.

        For Gerrit Dashboard: QTBUG-137540
        # Subject Branch Project Status CR V

            ulherman Ulf Hermann
            ulherman Ulf Hermann
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes