icu icon indicating copy to clipboard operation
icu copied to clipboard

ICU-22950 Do not initialize currency for NumberPropertyMapper when useCurrency is false

Open nightelf3 opened this issue 1 year ago • 1 comments
trafficstars

resolveCurrency() slows down simple number formatting requests like:

for (int i = 0; i < 9999; i++)
  u_snprintf_u(buff, 100, u"%d", i);

Since icu4c doesn't use currency there, we can skip its initialization.

Checklist

  • [x] Required: Issue filed: https://unicode-org.atlassian.net/browse/ICU-22950
  • [x] Required: The PR title must be prefixed with a JIRA Issue number. Example: "ICU-1234 Fix xyz"
  • [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. Example: "ICU-1234 Fix xyz"
  • [ ] Issue accepted (done by Technical Committee after discussion)
  • [x] Tests included, if applicable
  • [x] API docs and/or User Guide docs changed or added, if applicable

nightelf3 avatar Oct 21 '24 18:10 nightelf3

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Oct 21 '24 18:10 CLAassistant

Hooray! The files in the branch are the same across the force-push. 😃

~ Your Friendly Jira-GitHub PR Checker Bot

The tests hadn't run again. I rebased, squashed, fixed a couple of typos in the commit message, force-pushed, and approved test runs.

markusicu avatar Feb 07 '25 22:02 markusicu