Revision a5b76bb...
Go back to digest for 4th May 2014Optimization in KDE Base
Milian Wolff committed changes in [kfilemetadata/KDE/4.13] src/extractors/plaintextextractor.cpp:
Optimize word count in PlainTextExtractor.
Regular expressions are notoriously slow. Implementing a simple
word-count directly in C++ is much faster, as shown by the benchmark:
Before:
RESULT : IndexerExtractorTests::benchMarkPlainTextExtractor():
697.0 msecs per iteration (total: 6,970, iterations: 10)
After:
RESULT : IndexerExtractorTests::benchMarkPlainTextExtractor():
88.2 msecs per iteration (total: 883, iterations: 10)
REVIEW: 117789
File Changes
Modified 1 files
- src/extractors/plaintextextractor.cpp
1 files changed in total