mirror of
https://github.com/quickwit-oss/tantivy.git
synced 2026-01-07 01:32:53 +00:00
added todo
This commit is contained in:
9
TODO.md
9
TODO.md
@@ -1,2 +1,9 @@
|
||||
error management
|
||||
put store out of the
|
||||
split directory
|
||||
add doc values
|
||||
implement serial for segment reader
|
||||
merge segments
|
||||
documentation
|
||||
split postings into blocks
|
||||
add term frequency
|
||||
use skip list for each blocks
|
||||
|
||||
@@ -79,7 +79,6 @@ impl<T: Postings> IntersectionPostings<T> {
|
||||
postings: postings,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
impl<T: Postings> Iterator for IntersectionPostings<T> {
|
||||
@@ -163,3 +162,38 @@ mod tests {
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
|
||||
use super::*;
|
||||
use test::Bencher;
|
||||
use rand::Rng;
|
||||
use rand::SeedableRng;
|
||||
use rand::StdRng;
|
||||
|
||||
fn generate_array(n: usize, ratio: f32) -> Vec<u32> {
|
||||
let seed: &[_] = &[1, 2, 3, 4];
|
||||
let mut rng: StdRng = SeedableRng::from_seed(seed);
|
||||
(0..u32::max_value())
|
||||
.filter(|_| rng.next_f32()< ratio)
|
||||
.take(n)
|
||||
.collect()
|
||||
}
|
||||
|
||||
#[bench]
|
||||
fn bench_intersection(b: &mut Bencher) {
|
||||
const TEST_SIZE: usize = 100_000;
|
||||
let arr = generate_array(TEST_SIZE, 0.1);
|
||||
let mut encoder = Encoder::new();
|
||||
let encoded = encoder.encode(&arr);
|
||||
let mut uncompressed: Vec<u32> = (0..TEST_SIZE as u32).collect();
|
||||
let decoder = Decoder;
|
||||
b.iter(|| {
|
||||
decoder.decode(&encoded, &mut uncompressed);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user