icu icon indicating copy to clipboard operation
icu copied to clipboard

ICU-21946 RBBI Break Cache Optimizations

Open aheninger opened this issue 3 years ago • 5 comments

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

aheninger avatar May 21 '22 19:05 aheninger

Does this subsume/replace PR #2039 or does it go on top of that?

markusicu avatar Jun 01 '22 22:06 markusicu

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.

aheninger avatar Jun 02 '22 01:06 aheninger

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.

markusicu avatar Jun 08 '22 02:06 markusicu

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

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

Can I ping Markus for a review? I'd like to finish off this PR.

aheninger avatar Jul 14 '22 22:07 aheninger