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

Simple yet very efficient android deployment (qmlimportscanner) optimization

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 6.2.2
    • Fix Version/s: None
    • Labels:
      None
    • Platform/s:
      Android, Windows

      Description

      qmlimportscanner.exe is quite slow and it makes the whole deployment to android very slow.

      This is a very simple multithreading optimization to parse the files in different threads.

       

      The whole deployment of my simple project in QtCreator to my Android device, with no compilation, only the deployment, was taking 2min05 and it now takes 34s.

       

      And it can probably be optimized even more.

      for (const QFileInfo &x : entries)
                  if (x.isFile())
                      ret = mergeImports(ret, findQmlImportsInFile(x.absoluteFilePath()));
      

      to

      QList<QString> absoluteFilePathes;
              for (const QFileInfo &x : entries)
                  if (x.isFile())
                      absoluteFilePathes.push_back(x.absoluteFilePath());        QFuture< QVariantList > res;
              res = QtConcurrent::mappedReduced(absoluteFilePathes, findQmlImportsInFile, mergeImports2);
              res.waitForFinished();ret += res.result();
      

       

        Attachments

        1. main.cpp
          28 kB
          Jean Delajungle

          Issue Links

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

            Activity

              People

              Assignee:
              qtandroidteam Qt Android Team
              Reporter:
              satirik Jean Delajungle
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes