Add an append(QByteArray) method to the ExtractionResult
Review Request #117996 - Created May 5, 2014 and submitted
Add an append(QByteArray) method to the ExtractionResult This way plugins can choose to return the data in utf8 or as a QString, and the clients can either just let the standard QString::fromUtf8 function do its magic, or implement some special handling if they wish. This speeds up the PlainTextExtractor quite a bit (60msec vs 8.3msec) Unfortunately, this meant discarding the extraction of WordCount from the Plain Text extractor. Though considering the speed difference, I think it is worth it.
What is the speed difference compared to the old QString API, but without the word-count there? Afaik, the word-count is the major bottleneck and removing it alone should greatly speed up the test. Having a QByteArray in the API would be fine if you document that the data _must_ be UTF8. But a meaningful performance test here must include the later conversion to std::string for xapian, imo. I.e. what you want to test is file -> qbytearray -> std::string vs. file -> qstring -> std::string.
OK but then I don't get why you can compile this. You provide a definition of the pure-virtual declaration here, no? That's not going to compile, is it? Generally, I'd say don't make it pure-virtual as you can provide a meaningful default-implementation here... Only for performance reasons would one want to reimplement it after all.
Review request changed