Skip to content

Commit

Permalink
Add more benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianKnodt committed Jan 8, 2021
1 parent fb8cc7b commit e5094a2
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion library/core/benches/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,29 @@ bench_sums! {
bench_sums! {
bench_cycle_take_sum,
bench_cycle_take_ref_sum,
(0i64..10000).cycle().take(1000000)
(0..10000).cycle().take(1000000)
}

bench_sums! {
bench_cycle_skip_take_sum,
bench_cycle_skip_take_ref_sum,
(0..100000).cycle().skip(1000000).take(1000000)
}

bench_sums! {
bench_cycle_take_skip_sum,
bench_cycle_take_skip_ref_sum,
(0..100000).cycle().take(1000000).skip(100000)
}

bench_sums! {
bench_skip_cycle_skip_zip_add_sum,
bench_skip_cycle_skip_zip_add_ref_sum,
(0..100000).skip(100).cycle().skip(100)
.zip((0..100000).cycle().skip(10))
.map(|(a,b)| a+b)
.skip(100000)
.take(1000000)
}

// Checks whether Skip<Zip<A,B>> is as fast as Zip<Skip<A>, Skip<B>>, from
Expand Down

0 comments on commit e5094a2

Please sign in to comment.