diff options
author | Andreas Kling <andreas.kling@nokia.com> | 2011-03-15 13:20:03 (GMT) |
---|---|---|
committer | Andreas Kling <andreas.kling@nokia.com> | 2011-03-15 15:50:20 (GMT) |
commit | 3a2bb048b49e8d009d785ddd4c0ed221766cc11e (patch) | |
tree | 1a568abade12d49a6845cb48696184f6e5b40564 /qmake/generators | |
parent | 32d872a3456ecd7cb8c0f0437a7301e1c476bbd3 (diff) | |
download | Qt-3a2bb048b49e8d009d785ddd4c0ed221766cc11e.zip Qt-3a2bb048b49e8d009d785ddd4c0ed221766cc11e.tar.gz Qt-3a2bb048b49e8d009d785ddd4c0ed221766cc11e.tar.bz2 |
Don't cache resolved paths in MakefileGenerator::fileFixify().
The cache ends up dog-slow because of poor distribution in hashing
of QStrings, and even with a better hashing function, computing the
result on the fly is still faster.
Tested with WebCore.pro, on Linux processing time goes from 58 to
8 seconds, and on Windows from 105 to 65 seconds.
Reviewed-by: Marius Storm-Olsen
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/makefile.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 595768f..7963976 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2813,17 +2813,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q return file; QString ret = unescapeFilePath(file); - //setup the cache - static QHash<FileFixifyCacheKey, QString> *cache = 0; - if(!cache) { - cache = new QHash<FileFixifyCacheKey, QString>; - qmakeAddCacheClear(qmakeDeleteCacheClear<QHash<FileFixifyCacheKey, QString> >, (void**)&cache); - } - FileFixifyCacheKey cacheKey(ret, out_d, in_d, fix, canon); - QString cacheVal = cache->value(cacheKey); - if(!cacheVal.isNull()) - return cacheVal; - //do the fixin' QString pwd = qmake_getpwd(); if (!pwd.endsWith('/')) @@ -2908,7 +2897,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(), ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(), pwd.toLatin1().constData(), Option::output_dir.toLatin1().constData()); - cache->insert(cacheKey, ret); return ret; } |