Skip to content

[browser][non-icu] HybridGlobalization initialized performance tests#84829

Merged
radekdoulik merged 1 commit intodotnet:mainfrom
ilonatommy:hg-init-perf-tests
Apr 14, 2023
Merged

[browser][non-icu] HybridGlobalization initialized performance tests#84829
radekdoulik merged 1 commit intodotnet:mainfrom
ilonatommy:hg-init-perf-tests

Conversation

@ilonatommy
Copy link
Member

@ilonatommy ilonatommy commented Apr 14, 2023

Initializes performance tests for the existing HybridGlobalization functionalities:

  • TextInfo.ToLower,
  • TextInfo.ToUpper,
  • TextInfo.ToTitleCase,
  • CompareInfo.Compare,
  • String.Compare,
  • String.Equals.

All the tests are done on non-ASCII characters because only then HybridGlobalization path is guaranteed to be triggered. Existing, normalization test are using ICU4C api, no matter if HG is on or off.

Quick overwiev of performance differences between ICU4C and HybridGlobalization:

Test name time ICU4C [ms] time HG [ms] increase by [times]
TextInfo ToLower 0.2605 0.5065 1.94
TextInfo ToUpper 0.2672 0.5174 1.93
TextInfo ToTileCase 9.7404 14.7189 1.51
String Compare 0.0384 0.1286 3.35
String Equals 0.0378 0.1300 3.44
CompareInfo Compare 0.0383 0.1291 3.37

cc @SamMonoRT

@ghost
Copy link

ghost commented Apr 14, 2023

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Initializes performance tests for the existing HybridGlobalization functionalities:

  • TextInfo.ToLower,
  • TextInfo.ToUpper,
  • TextInfo.ToTitleCase,
  • CompareInfo.Compare,
  • String.Compare,
  • String.Equals.

All the tests are done on non-ASCII characters because only then HybridGlobalization path is guaranteed to be triggered. Existing, normalization test are using ICU4C api, no matter if HG is on or off.

Quick overwiev of performance differences between ICU4C and HybridGlobalization:

Test name time ICU4C [ms] time HG [ms] increase by [times]
TextInfo ToLower 0.5500 1.9275 3.50
TextInfo ToUpper 0.4536 1.8844 4.15
TextInfo ToTileCase 43.8194 37.8457 0.86
String Compare 0.0450 4.7881 106
String Equals 0.1395 4.7776 34
CompareInfo Compare 0.1393 4.7954 34

cc @SamMonoRT

Author: ilonatommy
Assignees: ilonatommy
Labels:

arch-wasm, area-System.Globalization

Milestone: -

Copy link
Member

@radekdoulik radekdoulik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@radekdoulik radekdoulik merged commit 932efb5 into dotnet:main Apr 14, 2023
@ghost ghost locked as resolved and limited conversation to collaborators May 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants