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

[PATCH] Optimize QIconLoader::findIconHelper()

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Done
    • Not Evaluated
    • None
    • 5.4.2, 5.5.0
    • None
    • 36aaf851ff2814e9e5c024e21b866c403137ff26

    Description

      Profiling QIconLoader::findIconHelper() shows that a significant portion of CPU time is being spent in QDir::exists(), which creates a new QFileInfo object for the sole purpose of determining whether the passed-in file path is relative or absolute, and then calls QFile::exists(). In this context, we can just as easily generate the absolute path and call QFile::exists() directly, avoiding the creation of extra QDir and QFileInfo objects.

      This change cuts the average CPU time of findIconHelper() in half, and reduces the startup time of Audacious by about 6%.

      Attachments

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

        Activity

          People

            sletta Gunnar Sletta
            john.lindgren@aol.com John Lindgren
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes