Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63067 Performance and memory consumption improvements for QtQml
  3. QTBUG-69588

Improve the memory consumption of AOT built cache files for 5.12

    XMLWordPrintable

Details

    Description

      The QML engine creates cache files that contain a dump of internal data structures on the fly when loading a .qml or .js file at run-time. These files are be mmap'ed and used right away. The only data structure that needs to be created from these are property caches.

      The qmlcachegen command line tool as well as CONFIG+=qtquickcompiler (or the cmake equivalent) make it possible to build these cache files ahead of time.

      Unfortunately at the time this step happens, the generator for these caches does not have the same degree of visibility into the type system as the QML engine at run-time. For example for signal handlers we cannot determine the names of the parameters yet. These limitations lead to a staged approach of using ahead-of-time generated cache files that skips the entire byte code generation - that has been done offline and can be re-used - but otherwise reconstructs the internal data structures. Those are subsequently used to perform a full type compilation and that also involves creating new data structures from the CompiledData name space.

      In 5.12 we can reduce the memory consumption when using such ahead-of-time generated cache files with two relatively unintrusive changes:

      (1) Avoid the re-creation of the indexed string table for the in-memory generated compilation unit and instead fall back to the memory mapped string table provided from the cache file.
      (2) Reduce the size of data structures in the CompiledData namespace so that their duplication reduces the size of the files as well as their memory consumption.

      Attachments

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

        Activity

          People

            shausman Simon Hausmann
            shausman Simon Hausmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: