summaryrefslogtreecommitdiffstats
path: root/third_party/rust/url/benches/parse_url.rs
blob: d6ac3c402feee75a8baace6cc765c6faec43b41e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[macro_use]
extern crate bencher;

extern crate url;

use bencher::{black_box, Bencher};

use url::Url;

fn short(bench: &mut Bencher) {
    let url = "https://example.com/bench";

    bench.bytes = url.len() as u64;
    bench.iter(|| black_box(url).parse::<Url>().unwrap());
}

benchmark_group!(benches, short);
benchmark_main!(benches);