3c915b534d
Profiler runs with gperftools showed we were spending a lot of time in strlen() even with compiled match patterns. If you compare a std::string with a plain C-string, the comparison operator needs to calculate the length of the C-string via strlen(). We can avoid this by turning all C-strings into C++ strings, which cache the string length internally. The match compiler has been adapted to collect all C-strings during compilation and aggregate them. Benchmark on the 'rpm' code base on a Core i7 920 box: cppcheck without matchcompiler: real 0m30.977s cppcheck with previous matchcompiler: real 0m28.157s cppcheck with cached C-strings: real 0m17.823s |
||
---|---|---|
.. | ||
dmake.cpp | ||
dmake.vcproj | ||
extracttests.py | ||
matchcompiler.py | ||
times-tags.sh | ||
times.c | ||
times.sh | ||
tools.pro |