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%.