-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#124320 (comment) command:
Original command:
-x64 -arm
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Globalization;
BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args);
[MemoryDiagnoser]
public class Bench
{
private char _hebrewChar;
private char _arabicChar;
private char _chineseChar;
private char _cyrillicChar;
[GlobalSetup]
public void Setup()
{
_hebrewChar = '\x05D0'; // Hebrew letter Aleph (from original issue)
_arabicChar = '\x0623'; // Arabic letter Alef with Hamza above
_chineseChar = '\u4E00'; // CJK Unified Ideograph
_cyrillicChar = '\u0410'; // Cyrillic Capital Letter A
}
[Benchmark]
public UnicodeCategory GetUnicodeCategory_Hebrew()
{
return char.GetUnicodeCategory(_hebrewChar);
}
[Benchmark]
public UnicodeCategory GetUnicodeCategory_Arabic()
{
return char.GetUnicodeCategory(_arabicChar);
}
[Benchmark]
public UnicodeCategory GetUnicodeCategory_Chinese()
{
return char.GetUnicodeCategory(_chineseChar);
}
[Benchmark]
public UnicodeCategory GetUnicodeCategory_Cyrillic()
{
return char.GetUnicodeCategory(_cyrillicChar);
}
}This will compare the PR against the base branch to confirm the ~1-3ns improvement for non-ASCII characters.
(EgorBot will reply in this issue)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels