-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICU-23000 Replace CharString for LocaleBased #3321
base: main
Are you sure you want to change the base?
Conversation
b4f7597
to
8554c0a
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
8554c0a
to
3340c4c
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
3340c4c
to
02d31a0
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
icu4c/source/common/locbased.h
Outdated
|
||
/** | ||
* Construct a LocaleBased wrapper around the two const pointers. | ||
* These will be aliased for the lifetime of this object. | ||
*/ | ||
inline LocaleBased(const char* validAlias, const char* actualAlias); | ||
inline LocaleBased(const CharString* validAlias, const CharString* actualAlias); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This, and the implementation which casts away const, looks wrong.
None of the classes that use LocaleBased should have const CharString
.
Please try to remove this constructor completely.
icu4c/source/common/locbased.cpp
Outdated
valid->clear(); | ||
valid->append(validID, -1, status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm. We should really have a CharString function overload
CharString ©From(StringPiece s, UErrorCode &errorCode);
to simplify such call sites. In particular, that would eliminate error checking because it wouldn't clear & replace when there is already a failure.
I can work on that as a follow-up if you like.
02d31a0
to
eda7ebb
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
eda7ebb
to
04d3b3b
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
PTAL |
The changes improve the overall peak memory usage and slightly improve performance main avg main stdev branch avg branch stdev diff avg diff avg % User time (seconds): 81.19 0.37 81.36 0.09 0.17 0.21% System time (seconds): 5.03 0.08 4.86 0.05 -0.17 -3.38% Percent of CPU this job got: 237.33% 0.01 235.33% 0.01 -2.00% -0.84% Maximum resident set size (kbytes): 227,141 99.14 226,667 366.48 -475 -0.21% Minor (reclaiming a frame) page faults: 46,009 510.78 43,775 294.47 -2,234 -4.86% Voluntary context switches: 333,442 4513.76 316,506 8850.48 -16,936 -5.08% Involuntary context switches: 467 30.60 515 22.65 48 10.36% Raw data in https://docs.google.com/spreadsheets/d/10LQ3kO83EwvsFfoiySTzsTbIzfUV00Te4jQnX0b_FM4/edit?usp=sharing
04d3b3b
to
e81ef87
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
These changes improve the overall peak memory usage and slightly improve
performance
Raw data in
https://docs.google.com/spreadsheets/d/10LQ3kO83EwvsFfoiySTzsTbIzfUV00Te4jQnX0b_FM4/edit?usp=sharing
Checklist