Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bench for api change #1467

Merged
merged 1 commit into from
Aug 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions fastfield_codecs/benches/bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ mod tests {
) {
let mut bytes = vec![];
S::serialize(&mut bytes, &data, stats_from_vec(data)).unwrap();
let reader = R::open_from_bytes(&bytes).unwrap();
let reader = R::open_from_bytes(OwnedBytes::new(bytes)).unwrap();
b.iter(|| {
for pos in value_iter() {
reader.get_u64(pos as u64, &bytes);
reader.get_u64(pos as u64);
}
});
}
Expand All @@ -49,6 +49,7 @@ mod tests {
});
}

use ownedbytes::OwnedBytes;
use test::Bencher;
#[bench]
fn bench_fastfield_bitpack_create(b: &mut Bencher) {
Expand Down
2 changes: 1 addition & 1 deletion fastfield_codecs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl FastFieldDataAccess for Vec<u64> {
self[position as usize]
}
fn iter<'b>(&'b self) -> Box<dyn Iterator<Item = u64> + 'b> {
Box::new((&self as &[u64]).iter().cloned())
Box::new((self as &[u64]).iter().cloned())
}
}

Expand Down