We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e46e848 commit 05d780fCopy full SHA for 05d780f
bench/parse.rs
@@ -34,5 +34,19 @@ pub fn parse_benchmark(c: &mut Criterion) {
34
group.finish();
35
}
36
37
-criterion_group!(benches, parse_benchmark);
+pub fn can_parse_benchmark(c: &mut Criterion) {
38
+ let mut group = c.benchmark_group("can_parse");
39
+ group.throughput(Throughput::Bytes(URLS.iter().map(|u| u.len() as u64).sum()));
40
+ group.bench_function("ada_url", |b| {
41
+ b.iter(|| {
42
+ URLS.iter().for_each(|url| {
43
+ let _ = ada_url::Url::can_parse(*black_box(url), None);
44
+ })
45
46
+ });
47
+ // TODO: Add `url` crate when it supports can_parse function.
48
+ group.finish();
49
+}
50
+
51
+criterion_group!(benches, parse_benchmark, can_parse_benchmark);
52
criterion_main!(benches);
0 commit comments