Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. qtquickcompiler
Forum Updated to NodeBB v4.3 + New Features

qtquickcompiler

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 4 Posters 1.0k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Anita
    wrote on last edited by
    #1

    In my code,
    I have added CONFIG+=qtquickcompiler to build my code.
    I am profiling my code to check for the timing of opening of a page.
    So in the type , there is a compilation time added in the begining.

    So i tried CONFIG-=qtquickcompiler to build my code. And the behavior was same.

    So what is the difference between having qtquickcompiler and without qtquickcompiler?

    sierdzioS J.HilkJ 2 Replies Last reply
    1
    • A Anita

      In my code,
      I have added CONFIG+=qtquickcompiler to build my code.
      I am profiling my code to check for the timing of opening of a page.
      So in the type , there is a compilation time added in the begining.

      So i tried CONFIG-=qtquickcompiler to build my code. And the behavior was same.

      So what is the difference between having qtquickcompiler and without qtquickcompiler?

      sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      @Anita said in qtquickcompiler:

      So what is the difference between having qtquickcompiler and without qtquickcompiler?

      I think it's always enabled since Qt 5.12 or something like it. Or was it replaced by QML cache mechanism? Not sure. But it is likely that it's simply a dummy config flag in modern Qt version.

      (Z(:^

      1 Reply Last reply
      0
      • sierdzioS Offline
        sierdzioS Offline
        sierdzio
        Moderators
        wrote on last edited by
        #3

        Ah, this page offers more insight: https://doc.qt.io/qt-5/qmldiskcache.html

        You can also specify CONFIG += qtquickcompiler in your .pro file to perform the compilation ahead of time and integrate the resulting byte code directly into your executable. For more information, see Qt Quick Compiler.

        So, you most like already have precompiled code stored in QML cache location - that's why you see no difference. Clear the cache and try again - a difference should be there.

        (Z(:^

        1 Reply Last reply
        1
        • A Anita

          In my code,
          I have added CONFIG+=qtquickcompiler to build my code.
          I am profiling my code to check for the timing of opening of a page.
          So in the type , there is a compilation time added in the begining.

          So i tried CONFIG-=qtquickcompiler to build my code. And the behavior was same.

          So what is the difference between having qtquickcompiler and without qtquickcompiler?

          J.HilkJ Online
          J.HilkJ Online
          J.Hilk
          Moderators
          wrote on last edited by
          #4

          @Anita in the project settings (in QtCreator)

          85167b1e-4b38-4804-844b-824ebda3019c-image.png

          is the combobox Qt Quick Compiler set to enabled ?

          I believe thats the default for quite some versions and probably replaces the CONFIG += qtquickcompiler


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          1 Reply Last reply
          1
          • KH-219DesignK Offline
            KH-219DesignK Offline
            KH-219Design
            wrote on last edited by
            #5

            To try and detect whether the qtquickcompiler config option is taking effect or not, you might refer to a recent thread about what exactly ends up inside a DLL (or Linux so) when that setting is toggled on or off: https://forum.qt.io/topic/121561/compiled-qml-sources-visible-inside-executable

            Specifically, you can see that by running (on Linux) the strings tool against a library, there will be symbols such as:

            _ZN21QmlCacheGeneratedCode23_qml_YourTypeName...
            

            inside a library when the qtquickcompiler option has been applied.

            If there is an open question lingering here that says "Hey, I have enabled qtquickcompiler but I still see last-minute, just-in-time compilation happening and slowing down my page load.... what is going on?"

            Discussion on that other thread led to a bug link, which then led to "re-discovery" and discussion of this commit:

            https://codereview.qt-project.org/c/qt/qtdeclarative/+/271898

            The commit message on that commit:

             Using the Qt Quick Compiler would [in the past] exclude the original .qml files ...
            This made it impossible to change the Qt library binary later as the program binary was tied the to the exact Qt version.
            

            If I understand that correctly, it implies that even when the optimized _ZN21QmlCacheGeneratedCode23_qml_ symbols are compiled into your DLL, they will potentially be ignored/unused if the Qt Framework DLL(s) at launch time are different than the Qt Framework DLL(s) used during build time.

            Depending on deployment tactics for your app, and depending on the terminal or other desktop environment settings that apply when you launch the app, it is entirely possible to unintentionally launch with (for example) a system-wide copy of the Qt Framework DLL(s), which might be a different set of DLL(s) than some developer-specific Qt framework instance installed in a non-standard folder that was used during the build.

            www.219design.com
            Software | Electrical | Mechanical | Product Design

            1 Reply Last reply
            1
            • KH-219DesignK Offline
              KH-219DesignK Offline
              KH-219Design
              wrote on last edited by
              #6

              That's a super interesting link from @sierdzio . I was unaware of QML_DISK_CACHE_PATH and QML_DISABLE_DISK_CACHE environment variables!

              They are apparently fairly recent additions. Apparently, prior to Qt 5.15.0, disk cache path cannot vary. Since then, it can vary based on environment variable QML_DISK_CACHE_PATH.

              www.219design.com
              Software | Electrical | Mechanical | Product Design

              1 Reply Last reply
              1

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved