ICU-21946 RBBI Break Cache Optimizations
Adjust RuleBasedBreakIterator::BreakCache::populateNear() to retain the cache contents in additional cases where they are still useful, resulting in improved performance.
This change is related to PR #2039, which addressed the same problem. This one retains the cache contents in more situations.
Checklist
- [x] Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-21946
- [x] Required: The PR title must be prefixed with a JIRA Issue number.
- [x] Required: The PR description must include the link to the Jira Issue, for example by completing the URL in the first checklist item
- [x] Required: Each commit message must be prefixed with a JIRA Issue number.
- [x] Issue accepted (done by Technical Committee after discussion)
- [x] Tests included, if applicable
- [ ] API docs and/or User Guide docs changed or added, if applicable
Does this subsume/replace PR #2039 or does it go on top of that?
Does this subsume/replace PR #2039 or does it go on top of that?
This PR subsumes/replaces #2039. This one covers the case #2039 fixes, plus additional cases where a useful break cache was being discarded for no good reason.
FYI I just glanced at the changes. They look roughly plausible, and no better person to know what they are doing here than Andy... let me know if you want me to look more deeply. I could try to squeeze it in.
Notice: the branch changed across the force-push!
- icu4c/source/common/rbbi_cache.cpp is different
- icu4j/main/classes/core/src/com/ibm/icu/text/RuleBasedBreakIterator.java is different
~ Your Friendly Jira-GitHub PR Checker Bot
Can I ping Markus for a review? I'd like to finish off this PR.