Skip to content

Commit 8e4331d

Browse files
authored
Add bench for to_ascii on an already-Punycode name (#915)
1 parent 9c51937 commit 8e4331d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

idna/benches/all.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ fn to_unicode_puny_label(bench: &mut Bencher) {
1111
bench.iter(|| config.to_unicode(black_box(encoded)));
1212
}
1313

14+
fn to_ascii_already_puny_label(bench: &mut Bencher) {
15+
let encoded = "abc.xn--mgbcm";
16+
let config = Config::default();
17+
bench.iter(|| config.to_ascii(black_box(encoded)));
18+
}
19+
1420
fn to_unicode_ascii(bench: &mut Bencher) {
1521
let encoded = "example.com";
1622
let config = Config::default();
@@ -47,6 +53,7 @@ benchmark_group!(
4753
to_unicode_ascii,
4854
to_unicode_merged_label,
4955
to_ascii_puny_label,
56+
to_ascii_already_puny_label,
5057
to_ascii_simple,
5158
to_ascii_merged,
5259
);

0 commit comments

Comments
 (0)