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

qrc: Qt Resource system is inefficient, especially on constrained devices

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • None
    • None

    Description

      The QResourceFileEngine, src/corelib/io/qresource.cpp, seems inefficient memory wise, which become noticeable especially on low-memory devices such as in the case of Symbian. Issues:

      Problem: Resource files are uncompressed completely into memory, not loaded incrementally/streamed. This means that opening a large file on a constrained device will not even work; heap allocation limitations or memory limits says no.
      Solution: Different approaches:
      1) Files larger than a certain threshold could be compressed in chunks/windows such that each chunk could be seeked/allocated separately.
      2) It is determined at compile time whether compression has any noticeable effect on the file, and is only done if so. In that case the file doesn't have to be heap allocated again in memory, and can remain paged on disk on operating systems which has that functionality.

      Problem: Correct me if wrong, but opening a file N times, leads to N heap allocations. I cannot find a cache, and see no reason for a cache to not be used since the engine supports read only files anyway. In the hypothetical case of supporting writable resource files, a copy-on-write design could be used.
      Solution: Use a simple, locked hash table to arrange a cache.

      Perhaps the above problem space can be seen directly as a virtual memory/paged system, and hence re-apply the solutions and theory relevant to those areas.

      This was discovered while adding resource support to Symbian's MMF-based Phonon backend, QTBUG-6562.

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              fenglich Frans Englich (closed Nokia identity)
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes