Skip to content

Commit ec2e4ba

Browse files
committed
Improve existing benchmarks to prevent extreme optimizations
1 parent 8884771 commit ec2e4ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/benches/iter.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,13 @@ bench_sums! {
185185
bench_sums! {
186186
bench_filter_sum,
187187
bench_filter_ref_sum,
188-
(0i64..1000000).filter(|x| x % 2 == 0)
188+
(0i64..1000000).filter(|x| x % 3 == 0)
189189
}
190190

191191
bench_sums! {
192192
bench_filter_chain_sum,
193193
bench_filter_chain_ref_sum,
194-
(0i64..1000000).chain(0..1000000).filter(|x| x % 2 == 0)
194+
(0i64..1000000).chain(0..1000000).filter(|x| x % 3 == 0)
195195
}
196196

197197
bench_sums! {

0 commit comments

Comments
 (0)