Important: Please read the Qt Code of Conduct -

Do directory import statements affect perfomance in QML?

  • When I import a folder in a QML file that contains several other QML documents, does that affect the performancy of the application?
    I have included a small example of code to show what I mean.

    import QtQuick 2.2
    import QtQuick.Controls 2.0
    // the "Components" folder contains several QML documents, but not all of them will be used in this QML file
    // Does including unnecessary files affects perfomance?
    import "Components" 
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
            anchors.centerIn: parent
            text: "This is a QML application"

  • Moderators

    everything which uses system resources impacts the performance...
    Filesystem access is mostly the bottleneck.
    About how many QML files are qml talking here? And whats their size?
    Also take into account that these qml files also have imports.

    So if application is performance critical you should do the effort and separate/categorize them into subfolders at least.

  • Well in this case I have about 20 qml files.

Log in to reply