Commit Graph

6 Commits

Author SHA1 Message Date
Marco Bubke
be939a80db Clang: Improve locking of string cache
The string cache is only very seldom written but very often read. To
improve thread scaling it is faster to lock it only for write operations.
So we use a shared mutex which is locked in shared mode for read
operations and locked exclusively for write operations.

Change-Id: I2cc742d1b9cc15c162be40ab339fa8310640bc44
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-05 17:48:23 +00:00
Marco Bubke
d2e15e5f1e Clang: Add file cache
The database is using file path integer ids to handle file paths because
otherwise we would save many redundant data. This patch is improving it
further with the introduction of a database based file path cache. The
entries are now divided in a directory path and file name. This is quite
handy for directory based file watching.

Change-Id: I03f2e388e43f3d521d6bf8e39dfb95eb2309dc73
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-05 17:36:37 +00:00
Marco Bubke
efcfb5ee15 Clang: Improve file path caching
The old algorithm was comparing the string two times. One timer for smaller
and one for larger. And memcmp on a long string still costs. The new one
has a three state so it can compare smaller, greater and equal in one.
There is a reverse version too which has big advantage for file paths.

Change-Id: Ica4024f0a071803c697e2c1f26edd3eb1b203f9f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:43 +00:00
Marco Bubke
f49a1d721c Clang: Add symbol storage
Extend file path cache to 64 bit integer.

Change-Id: I5627f13d59a3214f389087038482cbcc8d0eb484
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-29 16:37:24 +00:00
Marco Bubke
8617f497bc Utils: Cleanup StringCache
There is now a forward header and it is possible template the string type.

Change-Id: Ibebd32c475a2d89a90da7190e77d44278eb43740
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-08-28 13:47:26 +00:00
Marco Bubke
c072cdfb88 Clang: Add ClangPchManager
Compiling every header file again and again is quite time comsuming. There
are technics to improve this like preambles(a kind of automated
precompiled header) but they don't share their data between translation
units. This approach provides an automatically generated precompiled
header for every project and subproject to improve the loading time.

Change-Id: I34f5bd4db21951175920e2a9bbf6b97b1d705969
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-30 13:55:58 +00:00