Optimize word count in PlainTextExtractor.

Review Request #117789 - Created April 26, 2014 and submitted

Information
Milian Wolff
kfilemetadata
KDE/4.13
Reviewers
kdelibs
vhanda
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:
     702.0 msecs per iteration (total: 7,020, iterations: 10)
After:
     125.5 msecs per iteration (total: 1,256, iterations: 10)

Make the plaintext extractor benchmark more meaningful.

It now operates on a larger file and uses QBENCHMARK to actually get some data.

  

Issues

  • 2
  • 0
  • 0
  • 2
Description From Last Updated
Please update this link since it doesn't exist anymore. http://qt-project.org/doc/qt-5/qregexp.html ? Mark Gaiser Mark Gaiser
note to self: here and below the indentation is wrong (should be four spaces) Milian Wolff Milian Wolff
Vishesh Handa
Mark Gaiser
Milian Wolff
Commit Hook
This review has been submitted with commit a5b76bbd287d504477a9f27d64747f9bcfe50dbc by Milian Wolff to branch KDE/4.13.
Milian Wolff
Review request changed

Status: Closed (submitted)

Loading...