Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-19213 Improved caching for QML engine
  3. QTBUG-15920

More lightweight system for registering the same Qml types

    XMLWordPrintable

Details

    • Sub-task
    • Resolution: Done
    • Not Evaluated
    • 4.8.4
    • None
    • Times above were measured on Symbian, but the same issue is applicable for other platforms also.

    • b5e6ca71283f0f68b7ba6d9fe9663650751ad43e

    Description

      I was analysing in detail the construction of QDeclarativeEngine. Quite some part understandably goes to registering the Qml types via qmlRegisterType() -calls.

       
      61ms QDeclarativeEngine::QDeclarativeEngine(QObject*) (61ms in-thread, 39ms out-of-thread, 100ms both)
       60ms QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine*)
        16ms QDeclarativeItemModule::defineModule()
        10ms QDeclarativeUtilModule::defineModule()
        01ms QDeclarativeEnginePrivate::defineModule()
      

      (Times presented here are mostly the in-thread times, so in case of asynchronous operations the time spent in other threads is not visible.)

      I noticed that almost all of the registrations were done for both "QtQuick" and "Qt" -tags:

       
      void QDeclarativeItemModule::defineModule()
      {
      ...
          qmlRegisterType<QDeclarativeBorderImage>("QtQuick",1,0,"BorderImage");
      ...
      #ifndef QT_NO_IMPORT_QT47_QML
          qmlRegisterType<QDeclarativeBorderImage>("Qt",4,7,"BorderImage");
      ...
      

      The registeration for each type for "QtQuick" takes approx 120-150us (in-thread) inside QDeclarativeItemModule::defineModule(), where as it takes 70-80us for "Qt". I'm guess the element itself is the same for both. So, we can roughly calculate, that 1/3 third of the total time of registering types, goes to "Qt" tag. Could there be more efficient way of mapping also "Qt 4.7" for the Qml types already registered for "QtQuick 1.0"?

      ps. Not sure if this is already handled under http://bugreports.qt.nokia.com/browse/QTBUG-15331

      Attachments

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

        Activity

          People

            w00t Robin Burchell
            iippa Iiro Kause
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes