Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.1
-
None
Description
We can optimize PatternReplaceFilter:
- don't need to create Strings since CharTermAttribute implements CharSequence, just match directly against it.
- reuse the matcher, since CharTermAttribute is reused, too.
- don't create Strings/waste time in replaceAll/replaceFirst if the term doesn't match the regex at all... check with find() first.
There is more that could be done to make it faster for terms that do match, but this is simple and a start.
Attachments
Attachments
Issue Links
- is related to
-
LUCENE-2372 Replace deprecated TermAttribute by new CharTermAttribute
- Closed