-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Processing dotnet/runtime#123593 (comment) command:
Command
-x64 -arm
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
BenchmarkSwitcher.FromAssembly(typeof(Bench).Assembly).Run(args);
[MemoryDiagnoser]
public class Bench
{
private string _idnUrl = default!;
private string _aceUrl = default!;
private string _asciiUrl = default!;
[GlobalSetup]
public void Setup()
{
// IDN URL with non-ASCII characters that require punycode conversion
_idnUrl = "https://例え.jp/path?query=value";
// Already encoded ACE URL (xn-- prefix)
_aceUrl = "https://xn--r8jz45g.jp/path?query=value";
// Plain ASCII URL
_asciiUrl = "https://example.com/path?query=value";
}
[Benchmark]
public Uri ParseIdnUrl() => new Uri(_idnUrl);
[Benchmark]
public Uri ParseAceUrl() => new Uri(_aceUrl);
[Benchmark]
public Uri ParseAsciiUrl() => new Uri(_asciiUrl);
[Benchmark]
public string IdnHost() => new Uri(_idnUrl).IdnHost;
[Benchmark]
public string AceHost() => new Uri(_aceUrl).IdnHost;
}(EgorBot will reply in this issue)
Metadata
Metadata
Assignees
Labels
No labels