Skip to content

Commit

Permalink
fix: fixed benches highest/lowest index method (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: Luca Fulgenzi <luca.fulgenzi@justanother.cloud>
  • Loading branch information
lucafulgenzi and lucafulgenzi authored Jul 28, 2024
1 parent 35da020 commit e4a3bca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions benches/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ fn bench_highest_lowest_delta_w100(b: &mut test::Bencher) {
fn bench_highest_index_w10(b: &mut test::Bencher) {
let candles: Vec<_> = RandomCandles::new().take(1000).map(|c| c.close).collect();
let mut iter = candles.iter().cycle();
let mut method = Highest::new(10, &candles[0]).unwrap();
let mut method = HighestIndex::new(10, &candles[0]).unwrap();
for _ in 0..10 {
method.next(iter.next().unwrap());
}
Expand All @@ -734,7 +734,7 @@ fn bench_highest_index_w10(b: &mut test::Bencher) {
fn bench_highest_index_w100(b: &mut test::Bencher) {
let candles: Vec<_> = RandomCandles::new().take(1000).map(|c| c.close).collect();
let mut iter = candles.iter().cycle();
let mut method = Highest::new(100, &candles[0]).unwrap();
let mut method = HighestIndex::new(100, &candles[0]).unwrap();
for _ in 0..100 {
method.next(iter.next().unwrap());
}
Expand All @@ -746,7 +746,7 @@ fn bench_highest_index_w100(b: &mut test::Bencher) {
fn bench_lowest_index_w10(b: &mut test::Bencher) {
let candles: Vec<_> = RandomCandles::new().take(1000).map(|c| c.close).collect();
let mut iter = candles.iter().cycle();
let mut method = Lowest::new(10, &candles[0]).unwrap();
let mut method = LowestIndex::new(10, &candles[0]).unwrap();
for _ in 0..10 {
method.next(iter.next().unwrap());
}
Expand All @@ -757,7 +757,7 @@ fn bench_lowest_index_w10(b: &mut test::Bencher) {
fn bench_lowest_index_w100(b: &mut test::Bencher) {
let candles: Vec<_> = RandomCandles::new().take(1000).map(|c| c.close).collect();
let mut iter = candles.iter().cycle();
let mut method = Lowest::new(100, &candles[0]).unwrap();
let mut method = LowestIndex::new(100, &candles[0]).unwrap();
for _ in 0..100 {
method.next(iter.next().unwrap());
}
Expand Down

0 comments on commit e4a3bca

Please sign in to comment.