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/cachekeys.h | |
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/cachekeys.h')
-rw-r--r-- | qmake/cachekeys.h | 48 |
1 files changed, 0 insertions, 48 deletions
diff --git a/qmake/cachekeys.h b/qmake/cachekeys.h index 2957d61..b29e4f2 100644 --- a/qmake/cachekeys.h +++ b/qmake/cachekeys.h @@ -118,54 +118,6 @@ struct FileInfoCacheKey inline uint qHash(const FileInfoCacheKey &f) { return f.hashCode(); } // ------------------------------------------------------------------------------------------------- -struct FileFixifyCacheKey -{ - mutable uint hash; - QString in_d, out_d; - QString file, pwd; - uint fixType; - bool canonicalize; - FileFixifyCacheKey(const QString &f, const QString &od, const QString &id, - uint ft, bool c) - { - hash = 0; - pwd = qmake_getpwd(); - file = f; - if(od.isNull()) - out_d = Option::output_dir; - else - out_d = od; - if(id.isNull()) - in_d = qmake_getpwd(); - else - in_d = id; - fixType = ft; - canonicalize = c; - } - QString toString() const { - return file + "--" + in_d + "--" + out_d + "--" + pwd + "--" + - QString::number(fixType) + "--" + QString::number((int)canonicalize); - } - bool operator==(const FileFixifyCacheKey &f) const - { - return (f.canonicalize == canonicalize && - f.fixType == fixType && - f.file == file && - f.in_d == in_d && - f.out_d == out_d && - f.pwd == pwd); - } - inline uint hashCode() const { - if(!hash) - hash = uint(canonicalize) | uint(fixType) | - qHash(file) | qHash(in_d) | qHash(out_d) /*|qHash(pwd)*/; - return hash; - } -}; - -inline uint qHash(const FileFixifyCacheKey &f) { return f.hashCode(); } -// ------------------------------------------------------------------------------------------------- - template <typename T> inline void qmakeDeleteCacheClear(void *i) { delete reinterpret_cast<T*>(i); } |