Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Commit

Permalink
make the crate compile on stable again
Browse files Browse the repository at this point in the history
  • Loading branch information
irevoire committed Jul 14, 2022
1 parent eab1715 commit 10b42cc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 22 deletions.
1 change: 1 addition & 0 deletions milli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ csv = "1.1.6"
big_s = "1.0.2"
maplit = "1.0.2"
rand = "0.8.5"
select-rustc = "0.1"

[features]
default = []
43 changes: 23 additions & 20 deletions milli/src/heed_codec/roaring_bitmap/cbo_roaring_bitmap_codec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,13 +239,15 @@ mod tests {
assert_eq!(bitmap, expected);
}

extern crate test;
use test::Bencher;

#[bench]
fn bench_small_merge_cbo_roaring_bitmaps(bencher: &mut Bencher) {
std::thread::sleep_ms(30000);
#[rustfmt::skip]
#[cfg(feature = "nightly")]
mod bench {
extern crate test;
use test::Bencher;

#[bench]
fn bench_small_merge_cbo_roaring_bitmaps(bencher: &mut Bencher) {
std::thread::sleep_ms(30000);
#[rustfmt::skip]
let inputs = [
vec![Cow::Owned(vec![255, 56, 14, 0]), Cow::Owned(vec![196, 43, 14, 0])],
vec![Cow::Owned(vec![63, 101, 3, 0]), Cow::Owned(vec![71, 136, 3, 0])],
Expand All @@ -257,17 +259,17 @@ mod tests {
vec![Cow::Owned(vec![73, 176, 3, 0]), Cow::Owned(vec![126, 167, 3, 0])],
];

let mut vec = Vec::new();
for input in inputs {
bencher.iter(|| CboRoaringBitmapCodec::merge_into(&input, &mut vec));
vec.clear();
let mut vec = Vec::new();
for input in inputs {
bencher.iter(|| CboRoaringBitmapCodec::merge_into(&input, &mut vec));
vec.clear();
}
}
}

#[bench]
fn bench_medium_merge_cbo_roaring_bitmaps(bencher: &mut Bencher) {
std::thread::sleep_ms(1000);
#[rustfmt::skip]
#[bench]
fn bench_medium_merge_cbo_roaring_bitmaps(bencher: &mut Bencher) {
std::thread::sleep_ms(1000);
#[rustfmt::skip]
let inputs = [
vec![Cow::Owned(vec![232, 35, 9, 0]), Cow::Owned(vec![192, 10, 9, 0]), Cow::Owned(vec![91, 33, 9, 0]), Cow::Owned(vec![204, 29, 9, 0])],
vec![Cow::Owned(vec![144, 39, 9, 0]), Cow::Owned(vec![162, 66, 9, 0]), Cow::Owned(vec![146, 11, 9, 0]), Cow::Owned(vec![174, 61, 9, 0])],
Expand All @@ -279,10 +281,11 @@ mod tests {
vec![Cow::Owned(vec![215, 253, 13, 0]), Cow::Owned(vec![225, 194, 13, 0]), Cow::Owned(vec![37, 189, 13, 0]), Cow::Owned(vec![242, 212, 13, 0])],
];

let mut vec = Vec::new();
for input in inputs {
bencher.iter(|| CboRoaringBitmapCodec::merge_into(&input, &mut vec));
vec.clear();
let mut vec = Vec::new();
for input in inputs {
bencher.iter(|| CboRoaringBitmapCodec::merge_into(&input, &mut vec));
vec.clear();
}
}
}
}
3 changes: 1 addition & 2 deletions milli/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#![allow(soft_unstable)]
#![feature(test)]
#![cfg_attr(feature = "nightly", feature(test))]

#[macro_use]
pub mod documents;
Expand Down

0 comments on commit 10b42cc

Please sign in to comment.