-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
[browser][non-icu] HybridGlobalization
compare
#84249
Conversation
Tagging subscribers to 'arch-wasm': @lewing Issue DetailsImplements a chunk of web-api based globalization. Is a part of HybridGlobalization feature and contributes to #79989. Requires #84019 to be merged first (it has changes introducing Old, icu-based private API: GlobalizationNative_CompareString New, non-icu private API: CompareStringJS. Affected public API (see: tests in CompareInfoTests.Compare.cs):
All changes in behavior are listed in cc @SamMonoRT
|
HybridGlobalization
compare
Failures: Blazor WasmBuildTests and AOT timeouts are not connected. |
hiraganaBig.localeCompare(katakanaSmall, "en-US", { sensitivity: "base" }) // 0; base: a ≠ b, a = á, a = A | ||
``` | ||
|
||
- List of all `CompareOptions` combinations always throwing `PlatformNotSupportedException`: |
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.
In the future, could we use attributes or a compile time analyzer to make builds fail when the user's code attempts to use these combinations? (Obviously not in this PR)
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.
I think we could but I am not sure if I know how to do it. Do we have a similar mechanism somewhere already?
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.
I'm not sure, maybe ask in the group chat or channel. I haven't touched any of our generators/analyzers but I know we have a couple like the JSImport/Export generator.
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.WebAssembly.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.WebAssembly.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.Compare.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Globalization/tests/CompareInfo/CompareInfoTests.Compare.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/Globalization/CompareInfo.WebAssembly.cs
Outdated
Show resolved
Hide resolved
Failures not related. Merging to move forward. If there are any new ideas later, feel free to let me know and we will solve them in a follow-up, cc @pavelsavara, @radical. |
Implements a chunk of web-api based globalization. Is a part of HybridGlobalization feature and contributes to #79989.
Old, icu-based private API: GlobalizationNative_CompareString
New, non-icu private API: CompareString.
Affected public API (see: tests in CompareInfoTests.Compare.cs):
All changes in behavior are listed in
docs\design\features\hybrid-globalization.md
see final performance here: #85098
cc @SamMonoRT
Performance:
most of the processing time is taken by
mono_wasm_compare_string
(~60-70%) while ~50% is used for TextDecoder.decode and only up to 20% for localeCompare.