From 67783964de78299475cf826b0021040ef783e373 Mon Sep 17 00:00:00 2001 From: Tim Vermeulen Date: Sun, 17 Mar 2019 19:13:44 +0100 Subject: [PATCH] Add iter::{bench_partial_cmp, bench_lt} benchmarks --- src/libcore/benches/iter.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcore/benches/iter.rs b/src/libcore/benches/iter.rs index 825bd368bdf..7dcfad8306f 100644 --- a/src/libcore/benches/iter.rs +++ b/src/libcore/benches/iter.rs @@ -334,3 +334,13 @@ fn bench_filter_chain_ref_count(b: &mut Bencher) { (0i64..1000000).chain(0..1000000).map(black_box).by_ref().filter(|x| x % 3 == 0).count() }) } + +#[bench] +fn bench_partial_cmp(b: &mut Bencher) { + b.iter(|| (0..100000).map(black_box).partial_cmp((0..100000).map(black_box))) +} + +#[bench] +fn bench_lt(b: &mut Bencher) { + b.iter(|| (0..100000).map(black_box).lt((0..100000).map(black_box))) +}