From 9095098c229a01443b1464d5bf1705d78449d717 Mon Sep 17 00:00:00 2001 From: Michael Froh Date: Wed, 31 Jan 2024 16:55:48 +0000 Subject: [PATCH 01/12] Update to compile with latest Rust (part 1) This change addresses the low-hanging fruit: 1. Update rust-toolchain to a recent nightly. 2. Remove feature flags for invalid features. 3. Update feature usage (mostly MaybeUnInit::get_{ref,mut} and Vec::drain_filter. --- rust-toolchain | 2 +- src/core/codec/postings/for_util.rs | 16 +++++++------- src/core/codec/postings/terms_hash.rs | 10 ++++----- .../codec/postings/terms_hash_per_field.rs | 12 +++++----- .../term_vectors/term_vector_consumer.rs | 14 ++++++------ src/core/index/merge/merge_scheduler.rs | 2 +- .../index/writer/doc_writer_per_thread.rs | 16 +++++++------- src/core/index/writer/flush_policy.rs | 2 +- src/core/index/writer/index_file_deleter.rs | 4 ++-- src/core/index/writer/index_writer.rs | 4 ++-- src/core/search/query/spans/span_near.rs | 22 +++++++++---------- src/core/util/bits.rs | 3 ++- src/core/util/doc_id_set.rs | 2 +- src/lib.rs | 8 ++----- 14 files changed, 57 insertions(+), 60 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 7b70b33..207f9ec 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2020-03-12 +nightly-2024-01-30 diff --git a/src/core/codec/postings/for_util.rs b/src/core/codec/postings/for_util.rs index 0c985f5..4a48dc2 100644 --- a/src/core/codec/postings/for_util.rs +++ b/src/core/codec/postings/for_util.rs @@ -132,9 +132,9 @@ impl ForUtilInstance { let format = Format::with_id(format_id); encoded_sizes[bpv] = encoded_size(format, packed_ints_version, bits_per_value); unsafe { - decoders.get_mut()[bpv] = get_decoder(format, packed_ints_version, bits_per_value)?; - encoders.get_mut()[bpv] = get_encoder(format, packed_ints_version, bits_per_value)?; - iterations[bpv] = compute_iterations(&decoders.get_ref()[bpv]); + decoders.assume_init_mut()[bpv] = get_decoder(format, packed_ints_version, bits_per_value)?; + encoders.assume_init_mut()[bpv] = get_encoder(format, packed_ints_version, bits_per_value)?; + iterations[bpv] = compute_iterations(&decoders.assume_init_ref()[bpv]); } } @@ -168,9 +168,9 @@ impl ForUtilInstance { debug_assert!(bits_per_value <= 32); encoded_sizes[bpv - 1] = encoded_size(format, VERSION_CURRENT, bits_per_value); unsafe { - decoders.get_mut()[bpv - 1] = get_decoder(format, VERSION_CURRENT, bits_per_value)?; - encoders.get_mut()[bpv - 1] = get_encoder(format, VERSION_CURRENT, bits_per_value)?; - iterations[bpv - 1] = compute_iterations(&decoders.get_ref()[bpv - 1]); + decoders.assume_init_mut()[bpv - 1] = get_decoder(format, VERSION_CURRENT, bits_per_value)?; + encoders.assume_init_mut()[bpv - 1] = get_encoder(format, VERSION_CURRENT, bits_per_value)?; + iterations[bpv - 1] = compute_iterations(&decoders.assume_init_ref()[bpv - 1]); } output.write_vint(format.get_id() << 5 | (bits_per_value - 1))?; @@ -221,7 +221,7 @@ impl ForUtilInstance { } let encoded_size = self.encoded_sizes[num_bits - 1]; - let decoder = unsafe { &self.decoders.get_ref()[num_bits - 1] }; + let decoder = unsafe { &self.decoders.assume_init_ref()[num_bits - 1] }; if let Some(p) = partial_decoder { let format = match decoder { &BulkOperationEnum::Packed(_) => Format::Packed, @@ -410,7 +410,7 @@ impl ForUtil { assert!(num_bits > 0 && num_bits <= 32); let iters = self.instance.iterations[num_bits - 1]; - let encoder = unsafe { &self.instance.encoders.get_ref()[num_bits - 1] }; + let encoder = unsafe { &self.instance.encoders.assume_init_ref()[num_bits - 1] }; assert!(iters * encoder.byte_value_count() as i32 >= BLOCK_SIZE); let encoded_size = self.instance.encoded_sizes[num_bits - 1]; debug_assert!(iters * encoder.byte_block_count() as i32 >= encoded_size); diff --git a/src/core/codec/postings/terms_hash.rs b/src/core/codec/postings/terms_hash.rs index 8177801..1ac1194 100644 --- a/src/core/codec/postings/terms_hash.rs +++ b/src/core/codec/postings/terms_hash.rs @@ -262,7 +262,7 @@ where let mut all_fields = Vec::with_capacity(field_to_flush.len()); for (_, f) in field_to_flush { unsafe { - if !f.base().bytes_hash.get_ref().is_empty() { + if !f.base().bytes_hash.assume_init_ref().is_empty() { // TODO: Hack logic, it's because it's hard to gain param `field_to_flush` as // `HashMap<&str, &mut FreqProxTermsWriterPerField>` // this should be fixed later @@ -472,7 +472,7 @@ where fn new(terms_writer: &FreqProxTermsWriterPerField) -> Self { FreqProxTermsIterator { terms_writer, - num_terms: unsafe { terms_writer.base.bytes_hash.get_ref().len() }, + num_terms: unsafe { terms_writer.base.bytes_hash.assume_init_ref().len() }, ord: -1, scratch: BytesRef::default(), } @@ -487,7 +487,7 @@ where } fn set_bytes(&mut self, term_id: usize) { - let idx = unsafe { self.terms().base.bytes_hash.get_ref().ids[term_id] as usize }; + let idx = unsafe { self.terms().base.bytes_hash.assume_init_ref().ids[term_id] as usize }; let text_start = self.terms().base.postings_array.base.text_starts[idx]; self.scratch = self .terms() @@ -589,7 +589,7 @@ where let mut pos_iter = FreqProxPostingsIterator::new(self.terms()); unsafe { pos_iter - .reset(self.terms().base.bytes_hash.get_ref().ids[self.ord as usize] as usize); + .reset(self.terms().base.bytes_hash.assume_init_ref().ids[self.ord as usize] as usize); } Ok(FreqProxPostingIterEnum::Postings(pos_iter)) } else { @@ -604,7 +604,7 @@ where let mut pos_iter = FreqProxDocsIterator::new(self.terms()); unsafe { pos_iter - .reset(self.terms().base.bytes_hash.get_ref().ids[self.ord as usize] as usize); + .reset(self.terms().base.bytes_hash.assume_init_ref().ids[self.ord as usize] as usize); } Ok(FreqProxPostingIterEnum::Docs(pos_iter)) } diff --git a/src/core/codec/postings/terms_hash_per_field.rs b/src/core/codec/postings/terms_hash_per_field.rs index 81a477e..0f3de09 100644 --- a/src/core/codec/postings/terms_hash_per_field.rs +++ b/src/core/codec/postings/terms_hash_per_field.rs @@ -103,7 +103,7 @@ impl TermsHashPerFieldBase { self.byte_pool = &mut parent.byte_pool; self.term_byte_pool = parent.term_byte_pool; unsafe { - self.bytes_hash.get_mut().pool = parent.term_byte_pool; + self.bytes_hash.assume_init_mut().pool = parent.term_byte_pool; } } @@ -215,7 +215,7 @@ impl TermsHashPerFieldBase { pub fn sort_postings(&mut self) { debug_assert!(self.inited); unsafe { - self.bytes_hash.get_mut().sort(); + self.bytes_hash.assume_init_mut().sort(); } } @@ -240,7 +240,7 @@ pub trait TermsHashPerField: Ord + PartialOrd + Eq + PartialEq { fn reset(&mut self) { unsafe { - self.base_mut().bytes_hash.get_mut().clear(false); + self.base_mut().bytes_hash.assume_init_mut().clear(false); } } @@ -269,7 +269,7 @@ pub trait TermsHashPerField: Ord + PartialOrd + Eq + PartialEq { let term_id = unsafe { self.base_mut() .bytes_hash - .get_mut() + .assume_init_mut() .add_by_pool_offset(text_start) }; self.base_mut().add(term_id); @@ -293,12 +293,12 @@ pub trait TermsHashPerField: Ord + PartialOrd + Eq + PartialEq { // term text into text_start address let bytes_ref = BytesRef::new(&token_stream.token().term); - let term_id = unsafe { self.base_mut().bytes_hash.get_mut().add(&bytes_ref) }; + let term_id = unsafe { self.base_mut().bytes_hash.assume_init_mut().add(&bytes_ref) }; if term_id >= 0 { unsafe { self.base_mut() .bytes_hash - .get_ref() + .assume_init_ref() .byte_start(term_id as usize); } } diff --git a/src/core/codec/term_vectors/term_vector_consumer.rs b/src/core/codec/term_vectors/term_vector_consumer.rs index 6316eb1..6bb27ad 100644 --- a/src/core/codec/term_vectors/term_vector_consumer.rs +++ b/src/core/codec/term_vectors/term_vector_consumer.rs @@ -641,13 +641,13 @@ where } self.do_vectors = false; - let num_postings = unsafe { self.base.bytes_hash.get_ref().len() }; + let num_postings = unsafe { self.base.bytes_hash.assume_init_ref().len() }; // This is called once, after inverting all occurrences // of a given field in the doc. At this point we flush // our hash into the DocWriter. unsafe { - self.base.bytes_hash.get_mut().sort(); + self.base.bytes_hash.assume_init_mut().sort(); } match &mut self.term_vectors_writer().0 { TermVectorsConsumerEnum::Raw(r) => { @@ -670,7 +670,7 @@ where } } for j in 0..num_postings { - let term_id = unsafe { self.base.bytes_hash.get_ref().ids[j] as usize }; + let term_id = unsafe { self.base.bytes_hash.assume_init_ref().ids[j] as usize }; let freq = self.base.postings_array.freqs[term_id]; // Get BytesPtr @@ -702,7 +702,7 @@ where fn reset(&mut self) { unsafe { - self.base.bytes_hash.get_mut().clear(false); + self.base.bytes_hash.assume_init_mut().clear(false); } } @@ -777,14 +777,14 @@ where debug_assert_ne!(field.field_type().index_options(), IndexOptions::Null); if first { unsafe { - if !self.base.bytes_hash.get_ref().is_empty() { + if !self.base.bytes_hash.assume_init_ref().is_empty() { // Only necessary if previous doc hit a // non-aborting exception while writing vectors in // this field: self.reset(); } - self.base.bytes_hash.get_mut().reinit(); + self.base.bytes_hash.assume_init_mut().reinit(); } self.has_payloads = false; self.do_vectors = field.field_type().store_term_vectors(); @@ -865,7 +865,7 @@ where /// RAMOutputStream, which is then quickly flushed to /// the real term vectors files in the Directory. fn finish(&mut self, _field_state: &FieldInvertState) -> Result<()> { - if self.do_vectors && unsafe { !self.base.bytes_hash.get_ref().is_empty() } { + if self.do_vectors && unsafe { !self.base.bytes_hash.assume_init_ref().is_empty() } { self.term_vectors_writer().add_field_to_flush(self); } Ok(()) diff --git a/src/core/index/merge/merge_scheduler.rs b/src/core/index/merge/merge_scheduler.rs index 86d1ac5..80cf85d 100644 --- a/src/core/index/merge/merge_scheduler.rs +++ b/src/core/index/merge/merge_scheduler.rs @@ -493,7 +493,7 @@ impl MergeThrea let scheduler_mut = unsafe { self.merge_scheduler.inner.scheduler_mut(&l) }; scheduler_mut .merge_tasks - .drain_filter(|t| t.merge.id == one_merge.id); + .extract_if(|t| t.merge.id == one_merge.id); scheduler_mut.update_merge_threads(); // In case we had stalled indexing, we can now wake up // and possibly unstall: diff --git a/src/core/index/writer/doc_writer_per_thread.rs b/src/core/index/writer/doc_writer_per_thread.rs index 1239c37..3820a5b 100644 --- a/src/core/index/writer/doc_writer_per_thread.rs +++ b/src/core/index/writer/doc_writer_per_thread.rs @@ -167,7 +167,7 @@ where let consumer = DocConsumer::new(self, field_infos); self.consumer.write(consumer); unsafe { - self.consumer.get_mut().init(); + self.consumer.assume_init_mut().init(); } self.inited = true; @@ -213,7 +213,7 @@ where // vs non-aborting exceptions): let res = unsafe { self.consumer - .get_mut() + .assume_init_mut() .process_document(&mut self.doc_state, &mut doc) }; self.doc_state.clear(); @@ -273,7 +273,7 @@ where let res = unsafe { self.consumer - .get_mut() + .assume_init_mut() .process_document(&mut self.doc_state, &mut doc) }; if res.is_err() { @@ -388,7 +388,7 @@ where let mut flush_state = SegmentWriteState::new( Arc::clone(&self.directory), self.segment_info.clone(), - unsafe { self.consumer.get_ref().field_infos.finish()? }, + unsafe { self.consumer.assume_init_ref().field_infos.finish()? }, Some(&self.pending_updates), ctx, "".into(), @@ -438,11 +438,11 @@ where // re-init unsafe { - self.consumer.get_mut().reset_doc_writer(doc_writer); - self.consumer.get_mut().init(); + self.consumer.assume_init_mut().reset_doc_writer(doc_writer); + self.consumer.assume_init_mut().init(); } - let sort_map = unsafe { self.consumer.get_mut().flush(&mut flush_state)? }; + let sort_map = unsafe { self.consumer.assume_init_mut().flush(&mut flush_state)? }; self.pending_updates.deleted_terms.clear(); self.segment_info .set_files(&self.directory.create_files())?; @@ -596,7 +596,7 @@ where debug!("DWPT: now abort"); unsafe { - if let Err(e) = self.consumer.get_mut().abort() { + if let Err(e) = self.consumer.assume_init_mut().abort() { error!("DefaultIndexChain abort failed by error: '{:?}'", e); } } diff --git a/src/core/index/writer/flush_policy.rs b/src/core/index/writer/flush_policy.rs index a9db6b2..2cf9df0 100644 --- a/src/core/index/writer/flush_policy.rs +++ b/src/core/index/writer/flush_policy.rs @@ -183,7 +183,7 @@ impl FlushPolicy { if (self.index_write_config.flush_on_doc_count() && state.dwpt().num_docs_in_ram >= self.index_write_config.max_buffered_docs()) - || unsafe { state.dwpt().consumer.get_ref().need_flush() } + || unsafe { state.dwpt().consumer.assume_init_ref().need_flush() } { // Flush this state by num docs control.set_flush_pending(state, lg); diff --git a/src/core/index/writer/index_file_deleter.rs b/src/core/index/writer/index_file_deleter.rs index 75971e4..e090673 100644 --- a/src/core/index/writer/index_file_deleter.rs +++ b/src/core/index/writer/index_file_deleter.rs @@ -488,7 +488,7 @@ impl IndexFileDeleter { fn filter_dv_update_files(&self, candidates: &mut Vec<&String>) { let dv_update_files: Vec = candidates - .drain_filter(|f| -> bool { + .extract_if(|f| -> bool { self.fnm_pattern.is_match(f) || self.dv_pattern.is_match(f) }) .map(|f| f.clone()) @@ -502,7 +502,7 @@ impl IndexFileDeleter { .unwrap() .as_secs(); to_deletes = old_dv_update_files - .drain_filter(|(x, _)| -> bool { *x < tm_now }) + .extract_if(|(x, _)| -> bool { *x < tm_now }) .map(|(_, y)| y) .collect(); old_dv_update_files.push((tm_now + 60, dv_update_files)); diff --git a/src/core/index/writer/index_writer.rs b/src/core/index/writer/index_writer.rs index 5182f57..ee1a236 100644 --- a/src/core/index/writer/index_writer.rs +++ b/src/core/index/writer/index_writer.rs @@ -2846,9 +2846,9 @@ where self.segment_infos.remove(info); self.pending_num_docs .fetch_sub(info.info.max_doc as i64, Ordering::AcqRel); - if merge.segments.contains(info) { + if let Some(pos) = merge.segments.iter().position(|x| *x == *info) { self.merging_segments.remove(&info.info.name); - merge.segments.remove_item(info); + merge.segments.remove(pos); } self.reader_pool.drop(info.as_ref())?; } diff --git a/src/core/search/query/spans/span_near.rs b/src/core/search/query/spans/span_near.rs index 2e7af70..4a7a157 100644 --- a/src/core/search/query/spans/span_near.rs +++ b/src/core/search/query/spans/span_near.rs @@ -418,11 +418,11 @@ impl NearSpansUnordered

{ impl ConjunctionSpans

for NearSpansUnordered

{ fn conjunction_span_base(&self) -> &ConjunctionSpanBase

{ - unsafe { self.conjunction_span.get_ref() } + unsafe { self.conjunction_span.assume_init_ref() } } fn conjunction_span_base_mut(&mut self) -> &mut ConjunctionSpanBase

{ - unsafe { self.conjunction_span.get_mut() } + unsafe { self.conjunction_span.assume_init_mut() } } fn two_phase_current_doc_matches(&mut self) -> Result { @@ -431,8 +431,8 @@ impl ConjunctionSpans

for NearSpansUnordered

{ loop { if self.at_match() { unsafe { - self.conjunction_span.get_mut().first_in_current_doc = true; - self.conjunction_span.get_mut().one_exhausted_in_current_doc = false; + self.conjunction_span.assume_init_mut().first_in_current_doc = true; + self.conjunction_span.assume_init_mut().one_exhausted_in_current_doc = false; } return Ok(true); } @@ -450,8 +450,8 @@ impl ConjunctionSpans

for NearSpansUnordered

{ impl Spans for NearSpansUnordered

{ fn next_start_position(&mut self) -> Result { unsafe { - if self.conjunction_span.get_ref().first_in_current_doc { - self.conjunction_span.get_mut().first_in_current_doc = false; + if self.conjunction_span.assume_init_ref().first_in_current_doc { + self.conjunction_span.assume_init_mut().first_in_current_doc = false; return Ok(self.min_cell().start_position()); } } @@ -475,7 +475,7 @@ impl Spans for NearSpansUnordered

{ == NO_MORE_POSITIONS { unsafe { - self.conjunction_span.get_mut().one_exhausted_in_current_doc = true; + self.conjunction_span.assume_init_mut().one_exhausted_in_current_doc = true; } return Ok(NO_MORE_POSITIONS); } @@ -487,9 +487,9 @@ impl Spans for NearSpansUnordered

{ fn start_position(&self) -> i32 { unsafe { - if self.conjunction_span.get_ref().first_in_current_doc { + if self.conjunction_span.assume_init_ref().first_in_current_doc { -1 - } else if self.conjunction_span.get_ref().one_exhausted_in_current_doc { + } else if self.conjunction_span.assume_init_ref().one_exhausted_in_current_doc { NO_MORE_POSITIONS } else { self.min_cell().start_position() @@ -499,9 +499,9 @@ impl Spans for NearSpansUnordered

{ fn end_position(&self) -> i32 { unsafe { - if self.conjunction_span.get_ref().first_in_current_doc { + if self.conjunction_span.assume_init_ref().first_in_current_doc { -1 - } else if self.conjunction_span.get_ref().one_exhausted_in_current_doc { + } else if self.conjunction_span.assume_init_ref().one_exhausted_in_current_doc { NO_MORE_POSITIONS } else { self.sub_span_cells[self.max_end_position_cell_idx].end_position() diff --git a/src/core/util/bits.rs b/src/core/util/bits.rs index 5d269f0..4f959cd 100644 --- a/src/core/util/bits.rs +++ b/src/core/util/bits.rs @@ -418,7 +418,8 @@ impl Bits for SparseBits { impl BitsMut for SparseBits { fn get(&mut self, index: usize) -> Result { unsafe { - let ctx = &self.ctx as *const _ as *mut _; + //let ctx = &self.ctx as *const _ as *mut _; + let ctx = &mut self.ctx as *mut _; self.get64(&mut *ctx, index as i64) } } diff --git a/src/core/util/doc_id_set.rs b/src/core/util/doc_id_set.rs index 61acce8..95c44aa 100644 --- a/src/core/util/doc_id_set.rs +++ b/src/core/util/doc_id_set.rs @@ -361,7 +361,7 @@ impl DocIterator for NotDocIterator { #[derive(Debug)] pub struct EliasFanoDocIdSet { - ef_encoder: Arc, + ef_encoder:Arc, } impl EliasFanoDocIdSet { diff --git a/src/lib.rs b/src/lib.rs index 8a63258..5db0033 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,16 +16,12 @@ #![cfg_attr(feature = "clippy", plugin(clippy))] #![cfg_attr(not(feature = "clippy"), allow(unknown_lints))] #![feature(exact_size_is_empty)] -#![feature(drain_filter)] +#![feature(extract_if)] #![feature(hashmap_internals)] -#![feature(integer_atomics)] -#![feature(vec_remove_item)] +//#![feature(integer_atomics)] #![feature(specialization)] #![allow(clippy::cast_lossless)] #![feature(fn_traits)] -#![feature(maybe_uninit_ref)] -#![feature(maybe_uninit_extra)] -#![feature(in_band_lifetimes)] #![feature(vec_into_raw_parts)] #![feature(core_intrinsics)] #![feature(stmt_expr_attributes)] From eef794b91cf66536364aec56e3205d67ea1b9215 Mon Sep 17 00:00:00 2001 From: Michael Froh Date: Thu, 1 Feb 2024 18:41:11 +0000 Subject: [PATCH 02/12] Fix a bunch of compiler warnings We still have 12 compiler errors, mostly around casting &T to &mut T, but I wanted to clean up some warnings to reduce noise. --- src/core/codec/postings/for_util.rs | 8 ++--- src/core/codec/stored_fields/mod.rs | 1 - .../stored_fields/stored_fields_reader.rs | 2 +- src/core/doc/document.rs | 2 +- src/core/highlight/fragments_builder.rs | 6 ++-- src/core/index/merge/merge_scheduler.rs | 2 +- src/core/index/reader/segment_reader.rs | 2 +- .../index/writer/doc_writer_delete_queue.rs | 4 +-- src/core/index/writer/index_writer.rs | 2 +- .../search/collector/early_terminating.rs | 6 ++-- src/core/search/query/phrase_query.rs | 30 ++++++++----------- src/core/search/scorer/phrase_scorer.rs | 3 -- src/core/store/io/mmap_index_input.rs | 11 +++---- src/core/util/bkd/bkd_reader.rs | 5 ++-- src/core/util/bkd/bkd_writer.rs | 2 +- src/core/util/packed/packed_misc.rs | 26 ++++++++-------- 16 files changed, 48 insertions(+), 64 deletions(-) diff --git a/src/core/codec/postings/for_util.rs b/src/core/codec/postings/for_util.rs index 4a48dc2..866fa4a 100644 --- a/src/core/codec/postings/for_util.rs +++ b/src/core/codec/postings/for_util.rs @@ -72,10 +72,10 @@ pub fn max_data_size() -> usize { let iterations = compute_iterations(&decoder) as usize; max_data_size = max(max_data_size, iterations * decoder.byte_value_count()); } else { - panic!(format!( + panic!( "get_decoder({:?},{:?},{:?}) failed.", format, version, bpv - )); + ); } } let format = Format::PackedSingleBlock; @@ -84,10 +84,10 @@ pub fn max_data_size() -> usize { let iterations = compute_iterations(&decoder) as usize; max_data_size = max(max_data_size, iterations * decoder.byte_value_count()); } else { - panic!(format!( + panic!( "get_decoder({:?},{:?},{:?}) failed.", format, version, bpv - )); + ); } } } diff --git a/src/core/codec/stored_fields/mod.rs b/src/core/codec/stored_fields/mod.rs index 3ee489b..2b3e55b 100644 --- a/src/core/codec/stored_fields/mod.rs +++ b/src/core/codec/stored_fields/mod.rs @@ -30,7 +30,6 @@ pub use self::stored_fields_consumer::*; use core::analysis::TokenStream; use core::codec::field_infos::{FieldInfo, FieldInfos}; use core::codec::segment_infos::SegmentInfo; -use core::codec::stored_fields::CompressingStoredFieldsWriter; use core::codec::Codec; use core::doc::{FieldType, Fieldable, STORE_FIELD_TYPE}; use core::doc::{Status, StoredFieldVisitor}; diff --git a/src/core/codec/stored_fields/stored_fields_reader.rs b/src/core/codec/stored_fields/stored_fields_reader.rs index afcf722..8d530b2 100644 --- a/src/core/codec/stored_fields/stored_fields_reader.rs +++ b/src/core/codec/stored_fields/stored_fields_reader.rs @@ -656,7 +656,7 @@ impl CompressingStoredFieldsReader { Self::read_zdouble(input)?; } _ => { - debug_assert!(false, format!("Unknown type flag: {}", bits)); + debug_assert!(false, "Unknown type flag: {}", bits); } } Ok(()) diff --git a/src/core/doc/document.rs b/src/core/doc/document.rs index 910b0ca..691eacc 100644 --- a/src/core/doc/document.rs +++ b/src/core/doc/document.rs @@ -152,7 +152,7 @@ impl StoredFieldVisitor for DocumentStoredFieldVisitor { )); } Err(e) => { - panic!(format!("string_field failed: {:?}", e)); + panic!("string_field failed: {:?}", e); } } Ok(()) diff --git a/src/core/highlight/fragments_builder.rs b/src/core/highlight/fragments_builder.rs index 28e1fb8..c51def1 100644 --- a/src/core/highlight/fragments_builder.rs +++ b/src/core/highlight/fragments_builder.rs @@ -389,10 +389,8 @@ impl FragmentsBuilder for BaseFragmentsBuilder { assert!( max_num_fragments > 0, - format!( - "maxNumFragments({}) must be positive number.", - max_num_fragments - ) + "maxNumFragments({}) must be positive number.", + max_num_fragments ); let values = self.fields(reader, doc_id, field_name)?; diff --git a/src/core/index/merge/merge_scheduler.rs b/src/core/index/merge/merge_scheduler.rs index 80cf85d..3a38519 100644 --- a/src/core/index/merge/merge_scheduler.rs +++ b/src/core/index/merge/merge_scheduler.rs @@ -493,7 +493,7 @@ impl MergeThrea let scheduler_mut = unsafe { self.merge_scheduler.inner.scheduler_mut(&l) }; scheduler_mut .merge_tasks - .extract_if(|t| t.merge.id == one_merge.id); + .retain(|t| t.merge.id != one_merge.id); scheduler_mut.update_merge_threads(); // In case we had stalled indexing, we can now wake up // and possibly unstall: diff --git a/src/core/index/reader/segment_reader.rs b/src/core/index/reader/segment_reader.rs index 69c1763..6261271 100644 --- a/src/core/index/reader/segment_reader.rs +++ b/src/core/index/reader/segment_reader.rs @@ -665,7 +665,7 @@ impl SegmentReader { pub fn check_bounds(&self, doc_id: DocId) { debug_assert!( doc_id >= 0 && doc_id < self.max_docs(), - format!("doc_id={} max_docs={}", doc_id, self.max_docs(),) + "doc_id={} max_docs={}", doc_id, self.max_docs() ); } diff --git a/src/core/index/writer/doc_writer_delete_queue.rs b/src/core/index/writer/doc_writer_delete_queue.rs index a99020f..52120fe 100644 --- a/src/core/index/writer/doc_writer_delete_queue.rs +++ b/src/core/index/writer/doc_writer_delete_queue.rs @@ -360,10 +360,10 @@ impl Drop for DeleteListNode { if Arc::strong_count(&(*next)) <= 1 { Arc::get_mut(&mut *next).unwrap().next = AtomicPtr::default(); - Box::from_raw(next); + drop(Box::from_raw(next)); next = next2; } else { - Box::from_raw(next); + drop(Box::from_raw(next)); break; } } diff --git a/src/core/index/writer/index_writer.rs b/src/core/index/writer/index_writer.rs index ee1a236..76f815f 100644 --- a/src/core/index/writer/index_writer.rs +++ b/src/core/index/writer/index_writer.rs @@ -1458,7 +1458,7 @@ where { let lock = Arc::clone(&self.lock); let l = lock.lock()?; - let _ = self.abort_merges(l)?; + drop(self.abort_merges(l)?); } self.rate_limiters = Arc::new(ThreadLocal::new()); debug!("IW - rollback: done finish merges"); diff --git a/src/core/search/collector/early_terminating.rs b/src/core/search/collector/early_terminating.rs index a5c4790..655cac6 100644 --- a/src/core/search/collector/early_terminating.rs +++ b/src/core/search/collector/early_terminating.rs @@ -31,10 +31,8 @@ impl EarlyTerminatingSortingCollector { pub fn new(num_docs_to_collect_per_reader: usize) -> EarlyTerminatingSortingCollector { assert!( num_docs_to_collect_per_reader > 0, - format!( - "num_docs_to_collect_per_reader must always be > 0, got {}", - num_docs_to_collect_per_reader - ) + "num_docs_to_collect_per_reader must always be > 0, got {}", + num_docs_to_collect_per_reader ); EarlyTerminatingSortingCollector { diff --git a/src/core/search/query/phrase_query.rs b/src/core/search/query/phrase_query.rs index 4a99d06..ddfc0f3 100644 --- a/src/core/search/query/phrase_query.rs +++ b/src/core/search/query/phrase_query.rs @@ -74,7 +74,7 @@ impl PhraseQuery { ctxs.as_ref().map(Vec::len).unwrap_or_else(|| terms.len()), "Must have as many terms as positions" ); - assert!(slop >= 0, format!("Slop must be >= 0, got {}", slop)); + assert!(slop >= 0, "Slop must be >= 0, got {}", slop); if terms.len() < 2 { bail!(ErrorKind::IllegalArgument( "phrase query terms should not be less than 2!".into() @@ -88,16 +88,14 @@ impl PhraseQuery { ); } for pos in &positions { - debug_assert!(*pos >= 0, format!("Positions must be >= 0, got {}", pos)); + debug_assert!(*pos >= 0, "Positions must be >= 0, got {}", pos); } for i in 1..positions.len() { debug_assert!( positions[i - 1] <= positions[i], - format!( - "Positions should not go backwards, got {} before {}", - positions[i - 1], - positions[i] - ) + "Positions should not go backwards, got {} before {}", + positions[i - 1], + positions[i] ); } // normalize positions @@ -278,11 +276,10 @@ impl Weight for PhraseWeight { let mut term_iter = if let Some(field_terms) = reader.reader.terms(&self.field)? { debug_assert!( field_terms.has_positions()?, - format!( - "field {} was indexed without position data; cannot run PhraseQuery \ - (phrase={:?})", - self.field, self.terms - ) + "field {} was indexed without position data; cannot run PhraseQuery \ + (phrase={:?})", + self.field, + self.terms ); field_terms.iterator()? } else { @@ -356,11 +353,10 @@ impl Weight for PhraseWeight { let mut term_iter = if let Some(field_terms) = reader.reader.terms(&self.field)? { debug_assert!( field_terms.has_positions()?, - format!( - "field {} was indexed without position data; cannot run PhraseQuery \ - (phrase={:?})", - self.field, self.terms - ) + "field {} was indexed without position data; cannot run PhraseQuery \ + (phrase={:?})", + self.field, + self.terms ); Some(field_terms.iterator()?) } else { diff --git a/src/core/search/scorer/phrase_scorer.rs b/src/core/search/scorer/phrase_scorer.rs index d8f8bbe..68e5c61 100644 --- a/src/core/search/scorer/phrase_scorer.rs +++ b/src/core/search/scorer/phrase_scorer.rs @@ -326,8 +326,6 @@ struct PhrasePositions { pub ord: i32, // unique across all PhrasePositions instances pub postings: Rc>, - // stream of docs & positions - pub next_pp_idx: i32, // used to make list pub rpt_group: i32, // >=0 indicates that this is a repeating PP @@ -347,7 +345,6 @@ impl PhrasePositions { offset, ord, postings, - next_pp_idx: -1, rpt_group: -1, rpt_ind: 0, terms, diff --git a/src/core/store/io/mmap_index_input.rs b/src/core/store/io/mmap_index_input.rs index c06104c..9f1218d 100644 --- a/src/core/store/io/mmap_index_input.rs +++ b/src/core/store/io/mmap_index_input.rs @@ -127,7 +127,6 @@ pub struct MmapIndexInput { source: ReadOnlySource, position: usize, slice: &'static [u8], - description: String, } unsafe impl Send for MmapIndexInput {} @@ -143,7 +142,6 @@ impl From for MmapIndexInput { source, slice, position: 0, - description: String::from(""), } } } @@ -186,7 +184,7 @@ impl MmapIndexInput { } } - fn slice_impl(&self, description: &str, offset: i64, length: i64) -> Result { + fn slice_impl(&self, offset: i64, length: i64) -> Result { let total_len = self.len() as i64; if offset < 0 || length < 0 || offset + length > total_len { bail!(IllegalArgument(format!( @@ -200,7 +198,6 @@ impl MmapIndexInput { slice, source: self.source.clone(), position: 0, - description: description.to_string(), }) } @@ -238,7 +235,7 @@ impl IndexInput for MmapIndexInput { } fn random_access_slice(&self, offset: i64, length: i64) -> Result> { - let boxed = self.slice_impl("RandomAccessSlice", offset, length)?; + let boxed = self.slice_impl(offset, length)?; Ok(Box::new(boxed)) } @@ -250,8 +247,8 @@ impl IndexInput for MmapIndexInput { ptr } - fn slice(&self, description: &str, offset: i64, length: i64) -> Result> { - let boxed = self.slice_impl(description, offset, length)?; + fn slice(&self, _description: &str, offset: i64, length: i64) -> Result> { + let boxed = self.slice_impl(offset, length)?; Ok(Box::new(boxed)) } diff --git a/src/core/util/bkd/bkd_reader.rs b/src/core/util/bkd/bkd_reader.rs index 5ae40b9..493f202 100644 --- a/src/core/util/bkd/bkd_reader.rs +++ b/src/core/util/bkd/bkd_reader.rs @@ -279,7 +279,7 @@ impl BKDReader { } else { // Non-leaf node: recurse on the split left and right nodes let split_dim = state.index_tree.split_dim() as usize; - debug_assert!(split_dim as i32 >= 0, format!("split_dim={}", split_dim)); + debug_assert!(split_dim as i32 >= 0, "split_dim={}", split_dim); debug_assert!(split_dim < self.num_dims); let split_packed_value_idx = state.index_tree.split_packed_value_index(); @@ -1132,7 +1132,8 @@ impl IndexTree for PackedIndexTree { fn leaf_block_fp(&self) -> i64 { debug_assert!( self.is_leaf_node(), - format!("node_id={} is not a leaf", self.index_tree.node_id) + "node_id={} is not a leaf", + self.index_tree.node_id ); self.leaf_block_fp_stack[self.index_tree.level as usize] } diff --git a/src/core/util/bkd/bkd_writer.rs b/src/core/util/bkd/bkd_writer.rs index cb39fcc..c6f92d0 100644 --- a/src/core/util/bkd/bkd_writer.rs +++ b/src/core/util/bkd/bkd_writer.rs @@ -970,7 +970,7 @@ impl BKDWriter { let mut first_diff_byte_delta: i32; if prefix < self.bytes_per_dim { first_diff_byte_delta = (split_packed_values[address + prefix] as u32 as i32) - - (last_split_values[(split_dim * self.bytes_per_dim + prefix)] as u32 as i32); + - (last_split_values[split_dim * self.bytes_per_dim + prefix] as u32 as i32); if negative_deltas[split_dim] { first_diff_byte_delta *= -1; } diff --git a/src/core/util/packed/packed_misc.rs b/src/core/util/packed/packed_misc.rs index bc31ef5..dcba8be 100644 --- a/src/core/util/packed/packed_misc.rs +++ b/src/core/util/packed/packed_misc.rs @@ -1651,7 +1651,8 @@ impl Packed64SingleBlock { pub fn new(value_count: usize, bits_per_value: usize) -> Packed64SingleBlock { debug_assert!( Self::is_supported(bits_per_value), - format!("Unsupported number of bits per value: {}", bits_per_value) + "Unsupported number of bits per value: {}", + bits_per_value ); let value_per_block = 64 / bits_per_value; let blocks = vec![0i64; Self::required_capacity(value_count, value_per_block)]; @@ -2629,10 +2630,9 @@ impl PackedIntDecoder for BulkOperationPacked { fn decode_long_to_int(&self, blocks: &[i64], values: &mut [i32], iterations: usize) { if self.bits_per_value > 32 { - panic!(format!( - "Cannot decode {} -bits values into an i32 slice", + panic!("Cannot decode {} -bits values into an i32 slice", self.bits_per_value - )); + ); } let mut bits_left = 64; @@ -2815,10 +2815,9 @@ impl PackedIntDecoder for BulkOperationPackedSingleBlock { fn decode_long_to_int(&self, blocks: &[i64], values: &mut [i32], iterations: usize) { if self.bits_per_value > 32 { - panic!(format!( - "Cannot decode {} -bits values into an i32 slice", + panic!("Cannot decode {} -bits values into an i32 slice", self.bits_per_value - )); + ); } let mut values_offset = 0; for b in blocks.iter().take(iterations) { @@ -2828,10 +2827,9 @@ impl PackedIntDecoder for BulkOperationPackedSingleBlock { fn decode_byte_to_int(&self, blocks: &[u8], values: &mut [i32], iterations: usize) { if self.bits_per_value > 32 { - panic!(format!( - "Cannot decode {} -bits values into an i32 slice", + panic!("Cannot decode {} -bits values into an i32 slice", self.bits_per_value - )); + ); } let mut values_offset = 0; for i in 0..iterations { @@ -2986,8 +2984,8 @@ pub struct BlockPackedReaderIterator { block_size: usize, pub values: Vec, // 一下两个字段用于替代原始定义中的 `values_ref` 成员 - values_offset: usize, - values_length: usize, + //values_offset: usize, + //values_length: usize, blocks: Vec, off: usize, pub ord: i64, @@ -3029,8 +3027,8 @@ impl BlockPackedReaderIterator { value_count, block_size, values, - values_offset: 0, - values_length: 0, + //values_offset: 0, + //values_length: 0, blocks: vec![], off: block_size, ord: 0, From da792684625f5534fc0e6fc97b180446b4ae47bd Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Thu, 1 Feb 2024 18:52:20 +0000 Subject: [PATCH 03/12] Adding gitignore Signed-off-by: Harsha Vamsi Kalluri --- .gitignore | 1 + Cargo.lock | 829 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 830 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f97022 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/ \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..09485b8 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,829 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aho-corasick" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" +dependencies = [ + "memchr", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bit-set" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" + +[[package]] +name = "build_const" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +dependencies = [ + "byteorder", + "iovec", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chan" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d14956a3dae065ffaa0d92ece848ab4ced88d32361e7fdfbfd653a5c454a1ed8" +dependencies = [ + "rand 0.3.23", +] + +[[package]] +name = "chan-signal" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b829e3f5432da0cc46577d89fc88c937e78052e6735fb47ce0213b0db120b01" +dependencies = [ + "bit-set", + "chan", + "lazy_static 0.2.11", + "libc", +] + +[[package]] +name = "cloudabi" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "crc" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" +dependencies = [ + "build_const", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "crossbeam-utils", + "lazy_static 1.4.0", + "maybe-uninit", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" +dependencies = [ + "cfg-if 0.1.10", + "crossbeam-utils", + "maybe-uninit", +] + +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "lazy_static 1.4.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "backtrace", + "version_check", +] + +[[package]] +name = "fasthash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce56b715df3559085323d0a6724eccfd52994ac5abac9e9ffc6093853163f3bb" +dependencies = [ + "fasthash-sys", + "seahash", + "xoroshiro128", +] + +[[package]] +name = "fasthash-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6de941abfe2e715cdd34009d90546f850597eb69ca628ddfbf616e53dda28f8" +dependencies = [ + "gcc", +] + +[[package]] +name = "fastrand" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" + +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fuchsia-cprng" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" + +[[package]] +name = "gcc" +version = "0.3.55" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" + +[[package]] +name = "gimli" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "hermit-abi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "iovec" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" +dependencies = [ + "libc", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memmap" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" +dependencies = [ + "libc", + "rand 0.4.6", +] + +[[package]] +name = "rand" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" +dependencies = [ + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "rdrand", + "winapi", +] + +[[package]] +name = "rand" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" +dependencies = [ + "cloudabi", + "fuchsia-cprng", + "libc", + "rand_core 0.3.1", + "winapi", +] + +[[package]] +name = "rand_core" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +dependencies = [ + "rand_core 0.4.2", +] + +[[package]] +name = "rand_core" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" + +[[package]] +name = "rdrand" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" +dependencies = [ + "rand_core 0.3.1", +] + +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "regex" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", + "thread_local", + "utf8-ranges", +] + +[[package]] +name = "regex-syntax" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" +dependencies = [ + "ucd-util", +] + +[[package]] +name = "rucene" +version = "0.1.1" +dependencies = [ + "byteorder", + "bytes", + "chan", + "chan-signal", + "crc", + "crossbeam", + "crunchy", + "either", + "error-chain", + "fasthash", + "flate2", + "lazy_static 1.4.0", + "log", + "memmap", + "num-traits", + "num_cpus", + "rand 0.5.6", + "regex", + "serde", + "serde_derive", + "serde_json", + "smallvec", + "tempfile", + "thread_local", + "unicode_reader", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustix" +version = "0.38.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "seahash" +version = "3.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47" + +[[package]] +name = "serde" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.196" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.113" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "smallvec" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" +dependencies = [ + "maybe-uninit", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys", +] + +[[package]] +name = "thread_local" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" +dependencies = [ + "lazy_static 1.4.0", +] + +[[package]] +name = "ucd-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abd2fc5d32b590614af8b0a20d837f32eca055edd0bbead59a9cfe80858be003" + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + +[[package]] +name = "unicode_reader" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "001b27e8f5e9da465b3584051a3a3d2ebefee4f8595c49e96cc1deec9667e4cc" +dependencies = [ + "unicode-segmentation", +] + +[[package]] +name = "utf8-ranges" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + +[[package]] +name = "xoroshiro128" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0eeda34baec49c4f1eb2c04d59b761582fd6330010f9330ca696ca1a355dfcd" +dependencies = [ + "rand 0.4.6", +] From 8edf9aab6a44c64ef8f616a0172b7f964fd53915 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Tue, 6 Feb 2024 23:49:15 +0000 Subject: [PATCH 04/12] temp Signed-off-by: Harsha Vamsi Kalluri --- src/core/index/merge/merge_rate_limiter.rs | 47 ++--- src/core/index/merge/merge_scheduler.rs | 194 ++++++++++-------- .../search/collector/early_terminating.rs | 18 +- src/core/search/collector/timeout.rs | 16 +- src/core/util/external/volatile.rs | 12 +- 5 files changed, 155 insertions(+), 132 deletions(-) diff --git a/src/core/index/merge/merge_rate_limiter.rs b/src/core/index/merge/merge_rate_limiter.rs index 4f9c230..9937522 100644 --- a/src/core/index/merge/merge_rate_limiter.rs +++ b/src/core/index/merge/merge_rate_limiter.rs @@ -14,11 +14,12 @@ use core::store::RateLimiter; use core::index::ErrorKind::MergeAborted; +use std::cell::UnsafeCell; use error::{ErrorKind, Result}; use std::f64; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; -use std::sync::{Condvar, Mutex}; +use std::sync::{Condvar, Mutex, RwLock}; use std::time::{Duration, SystemTime}; use core::util::external::Volatile; @@ -31,12 +32,12 @@ use core::util::external::Volatile; /// much time it spent stopped and paused, and it supports aborting. pub struct MergeRateLimiter { total_bytes_written: AtomicU64, - mb_per_sec: Volatile, - last_time: Volatile, - min_pause_check_bytes: Volatile, + mb_per_sec: Mutex>, + last_time: Mutex>, + min_pause_check_bytes: Mutex>, abort: AtomicBool, - total_paused_dur: Volatile, - total_stopped_dur: Volatile, + total_paused_dur: Mutex>, + total_stopped_dur: Mutex>, // merge: OneMerge, lock: Mutex<()>, cond: Condvar, @@ -59,12 +60,12 @@ impl MergeRateLimiter { // Now is a good time to abort the merge: self.check_abort()?; - let mb_per_sec = self.mb_per_sec.read(); + let mb_per_sec = self.mb_per_sec.lock().unwrap().read(); let seconds_to_pause = bytes as f64 / 1024.0 / 1024.0 / mb_per_sec; // Time we should sleep until; this is purely instantaneous // rate (just adds seconds onto the last time we had paused to); // maybe we should also offer decayed recent history one? - let target_time = self.last_time.read() + let target_time = self.last_time.lock().unwrap().read() + Duration::from_nanos((seconds_to_pause * 1_000_000_000.0) as u64); if target_time < cur_ns { @@ -88,7 +89,7 @@ impl MergeRateLimiter { // CMS can wake us up here if it changes our target rate: let _ = self.cond.wait_timeout(l, cur_pause_dur)?; - let rate = self.mb_per_sec.read(); + let rate = self.mb_per_sec.lock().unwrap().read(); if rate == 0.0 { Ok(PauseResult::Stopped) } else { @@ -117,12 +118,12 @@ impl Default for MergeRateLimiter { fn default() -> Self { let limiter = MergeRateLimiter { total_bytes_written: AtomicU64::new(0), - mb_per_sec: Volatile::new(0.0), - last_time: Volatile::new(SystemTime::now()), - min_pause_check_bytes: Volatile::new(0), + mb_per_sec: Mutex::new(Volatile::new(0.0)), + last_time: Mutex::new(Volatile::new(SystemTime::now())), + min_pause_check_bytes: Mutex::new(Volatile::new(0)), abort: AtomicBool::new(false), - total_paused_dur: Volatile::new(Duration::default()), - total_stopped_dur: Volatile::new(Duration::default()), + total_paused_dur: Mutex::new(Volatile::new(Duration::default())), + total_stopped_dur: Mutex::new(Volatile::new(Duration::default())), lock: Mutex::new(()), cond: Condvar::new(), }; @@ -141,7 +142,7 @@ impl RateLimiter for MergeRateLimiter { panic!("mb_per_sec must be position; got: {}", mb_per_sec); } - self.mb_per_sec.write(mb_per_sec); + self.mb_per_sec.lock().unwrap().write(mb_per_sec); // NOTE: java Double.POSITIVE_INFINITY cast to long is long.MAX_VALUE, // rust f64::INFINITY cast to u64 is 0. let check_value = MIN_PAUSE_CHECK_MSEC as f64 / 1000.0 * mb_per_sec * 1024.0 * 1024.0; @@ -152,12 +153,12 @@ impl RateLimiter for MergeRateLimiter { check_value as u64 }; self.min_pause_check_bytes - .write(::std::cmp::min(64 * 1024 * 1024, check_bytes)); + .lock().unwrap().write(::std::cmp::min(64 * 1024 * 1024, check_bytes)); self.cond.notify_one(); } fn mb_per_sec(&self) -> f64 { - self.mb_per_sec.read() + self.mb_per_sec.lock().unwrap().read() } fn pause(&self, bytes: u64) -> Result { @@ -175,7 +176,7 @@ impl RateLimiter for MergeRateLimiter { if result == PauseResult::No { // Set to curNS, not targetNS, to enforce the instant rate, not // the "averaaged over all history" rate: - self.last_time.write(cur_time); + self.last_time.lock().unwrap().write(cur_time); break; } cur_time = SystemTime::now(); @@ -184,12 +185,12 @@ impl RateLimiter for MergeRateLimiter { // Separately track when merge was stopped vs rate limited: if result == PauseResult::Stopped { - let stopped_dur = self.total_stopped_dur.read(); - self.total_stopped_dur.write(stopped_dur + dur); + let stopped_dur = self.total_stopped_dur.lock().unwrap().read(); + self.total_stopped_dur.lock().unwrap().write(stopped_dur + dur); } else { debug_assert_eq!(result, PauseResult::Paused); - let total_paused_dur = self.total_stopped_dur.read(); - self.total_paused_dur.write(total_paused_dur + dur); + let total_paused_dur = self.total_stopped_dur.lock().unwrap().read(); + self.total_paused_dur.lock().unwrap().write(total_paused_dur + dur); } paused += dur; } @@ -197,6 +198,6 @@ impl RateLimiter for MergeRateLimiter { } fn min_pause_check_bytes(&self) -> u64 { - self.min_pause_check_bytes.read() + self.min_pause_check_bytes.lock().unwrap().read() } } diff --git a/src/core/index/merge/merge_scheduler.rs b/src/core/index/merge/merge_scheduler.rs index 3a38519..9744eb8 100644 --- a/src/core/index/merge/merge_scheduler.rs +++ b/src/core/index/merge/merge_scheduler.rs @@ -17,6 +17,8 @@ use core::index::merge::{MergePolicy, MergerTrigger, OneMerge, OneMergeScheduleI use core::index::writer::IndexWriter; use core::store::directory::Directory; use core::store::RateLimiter; +use std::borrow::BorrowMut; +use std::cell::UnsafeCell; use error::{Error, ErrorKind, Result}; @@ -139,7 +141,7 @@ impl Ord for MergeTaskInfo { /// throttle the incoming threads by pausing until one more more merges complete. #[derive(Clone)] pub struct ConcurrentMergeScheduler { - inner: Arc, + inner: Arc>, } impl Default for ConcurrentMergeScheduler { @@ -155,21 +157,23 @@ impl ConcurrentMergeScheduler { panic!("max thread count must not be 0"); } Self { - inner: Arc::new(ConcurrentMergeSchedulerInner::new(max_thread_count)), + inner: Arc::new(Mutex::new(ConcurrentMergeSchedulerInner::new( + max_thread_count), + )), } } } struct ConcurrentMergeSchedulerInner { - lock: Mutex<()>, - cond: Condvar, - merge_tasks: Vec, - max_merge_count: usize, - max_thread_count: usize, - merge_thread_count: usize, - target_mb_per_sec: f64, - do_auto_io_throttle: bool, - force_merge_mb_per_sec: f64, + lock: UnsafeCell>, + cond: UnsafeCell, + merge_tasks: UnsafeCell>, + max_merge_count: UnsafeCell, + max_thread_count: UnsafeCell, + merge_thread_count: UnsafeCell, + target_mb_per_sec: UnsafeCell, + do_auto_io_throttle: UnsafeCell, + force_merge_mb_per_sec: UnsafeCell, } // Floor for IO write rate limit (we will never go any lower than this) @@ -191,23 +195,26 @@ pub const MAX_MERGING_COUNT: usize = 5; impl ConcurrentMergeSchedulerInner { fn new(max_thread_count: usize) -> Self { ConcurrentMergeSchedulerInner { - lock: Mutex::new(()), - cond: Condvar::new(), - merge_tasks: vec![], - max_merge_count: max_thread_count.max(MAX_MERGING_COUNT), - max_thread_count, - merge_thread_count: 0, - target_mb_per_sec: START_MB_PER_SEC, - do_auto_io_throttle: true, - force_merge_mb_per_sec: f64::INFINITY, + lock: UnsafeCell::new(Mutex::new(())), + cond: UnsafeCell::new(Condvar::new()), + merge_tasks: UnsafeCell::new(vec![]), + max_merge_count: UnsafeCell::new(max_thread_count.max(MAX_MERGING_COUNT)), + max_thread_count: UnsafeCell::new(max_thread_count), + merge_thread_count: UnsafeCell::new(0), + target_mb_per_sec: UnsafeCell::new(START_MB_PER_SEC), + do_auto_io_throttle: UnsafeCell::new(true), + force_merge_mb_per_sec: UnsafeCell::new(f64::INFINITY), } } #[allow(clippy::mut_from_ref)] - unsafe fn scheduler_mut(&self, _guard: &MutexGuard<()>) -> &mut ConcurrentMergeSchedulerInner { + unsafe fn scheduler_mut( + &self, + _guard: UnsafeCell<&MutexGuard<()>>, + ) -> &mut ConcurrentMergeSchedulerInner { let scheduler = self as *const ConcurrentMergeSchedulerInner as *mut ConcurrentMergeSchedulerInner; - &mut *scheduler + unsafe { &mut *scheduler } } fn maybe_stall<'a, D, C, MP>( @@ -222,81 +229,93 @@ impl ConcurrentMergeSchedulerInner { { let thread_id = thread::current().id(); let mut guard = guard; - while writer.has_pending_merges() && self.merge_thread_count() >= self.max_merge_count { - // This means merging has fallen too far behind: we - // have already created maxMergeCount threads, and - // now there's at least one more merge pending. - // Note that only maxThreadCount of - // those created merge threads will actually be - // running; the rest will be paused (see - // updateMergeThreads). We stall this producer - // thread to prevent creation of new segments, - // until merging has caught up: - if self.merge_tasks.iter().any(|t| t.thread_id == thread_id) { - // Never stall a merge thread since this blocks the thread from - // finishing and calling updateMergeThreads, and blocking it - // accomplishes nothing anyway (it's not really a segment producer): - return (false, guard); - } + unsafe { + while writer.has_pending_merges() && self.merge_thread_count() >= *self.max_merge_count.get() { + // This means merging has fallen too far behind: we + // have already created maxMergeCount threads, and + // now there's at least one more merge pending. + // Note that only maxThreadCount of + // those created merge threads will actually be + // running; the rest will be paused (see + // updateMergeThreads). We stall this producer + // thread to prevent creation of new segments, + // until merging has caught up: + if self.merge_tasks.get_mut().iter().any(|t| t.thread_id == thread_id) { + // Never stall a merge thread since this blocks the thread from + // finishing and calling updateMergeThreads, and blocking it + // accomplishes nothing anyway (it's not really a segment producer): + return (false, guard); + } - // Defensively wait for only .25 seconds in case we are missing a .notify/All somewhere: - let (g, _) = self - .cond - .wait_timeout(guard, Duration::from_millis(25)) - .unwrap(); - guard = g; + // Defensively wait for only .25 seconds in case we are missing a .notify/All + // somewhere: + let (g, _) = *self + .cond + .get() + .wait_timeout(guard, Duration::from_millis(25)) + .unwrap(); + guard = g; + } } (true, guard) } fn update_merge_threads(&mut self) { - let mut active_tasks: Vec<_> = self.merge_tasks.iter().collect(); - active_tasks.sort(); - - let tasks_count = active_tasks.len(); - - let mut big_merge_count = 0; - for i in 0..tasks_count { - if active_tasks[tasks_count - 1 - i] - .merge - .estimated_merge_bytes - .read() as f64 - > MIN_BIG_MERGE_MB * 1024.0 * 1024.0 - { - big_merge_count = tasks_count - i; - break; + unsafe { + let mut active_tasks: Vec = self.merge_tasks.get_mut().iter().collect(); + active_tasks.sort(); + + let tasks_count = active_tasks.len(); + + let mut big_merge_count = 0; + for i in 0..tasks_count { + if active_tasks[tasks_count - 1 - i] + .merge + .estimated_merge_bytes + .read() as f64 + > MIN_BIG_MERGE_MB * 1024.0 * 1024.0 + { + big_merge_count = tasks_count - i; + break; + } } - } - for (idx, task) in active_tasks.iter().enumerate() { - // pause the thread if max_thread_count is smaller than the number of merge threads. - let do_pause = idx + self.max_thread_count < big_merge_count; - - let new_mb_per_sec = if do_pause { - 0.0 - } else if task.merge.max_num_segments.get().is_some() { - self.force_merge_mb_per_sec - } else if !self.do_auto_io_throttle - || ((task.merge.estimated_merge_bytes.read() as f64) - < MIN_BIG_MERGE_MB * 1024.0 * 1024.0) - { - f64::INFINITY - } else { - self.target_mb_per_sec - }; + for (idx, task) in active_tasks.iter().enumerate() { + // pause the thread if max_thread_count is smaller than the number of merge threads. + let do_pause = idx + self.max_thread_count < big_merge_count; + unsafe + + let new_mb_per_sec = if do_pause { + 0.0 + } else if task.merge.max_num_segments.get().is_some() { + self.force_merge_mb_per_sec + } else if !self.do_auto_io_throttle.get() + || ((task.merge.estimated_merge_bytes.read() as f64) + < MIN_BIG_MERGE_MB * 1024.0 * 1024.0) + { + f64::INFINITY + } else { + self.target_mb_per_sec.get() + }; - task.merge.rate_limiter.set_mb_per_sec(new_mb_per_sec); + task.merge.rate_limiter.set_mb_per_sec(new_mb_per_sec); + } } } fn merge_thread_count(&self) -> usize { let current_thread = thread::current().id(); - self.merge_tasks - .iter() - .filter(|t| { - t.thread_id != current_thread && t.thread_alive() && !t.merge.rate_limiter.aborted() - }) - .count() + unsafe { + self.merge_tasks + .get_mut() + .iter() + .filter(|t| { + t.thread_id != current_thread + && t.thread_alive() + && !t.merge.rate_limiter.aborted() + }) + .count() + } } fn update_io_throttle( @@ -394,7 +413,9 @@ impl MergeScheduler for ConcurrentMergeScheduler { MP: MergePolicy, { let mut guard = self.inner.lock.lock().unwrap(); - let scheduler = unsafe { self.inner.scheduler_mut(&guard) }; + let t = + guard.borrow_mut() as *mut MutexGuard<'_, ()> as *const UnsafeCell<&MutexGuard<'_, ()>>; + let scheduler = unsafe { self.inner.scheduler_mut((&guard).into()) }; if trigger == MergerTrigger::Closing { // Disable throttling on close: @@ -489,8 +510,9 @@ impl MergeThrea } Ok(()) => {} } - let l = self.merge_scheduler.inner.lock.lock().unwrap(); - let scheduler_mut = unsafe { self.merge_scheduler.inner.scheduler_mut(&l) }; + let mut l = self.merge_scheduler.inner.lock.lock().unwrap(); + let t = l.borrow_mut() as *mut MutexGuard<'_, ()> as *const UnsafeCell<&MutexGuard<'_, ()>>; + let scheduler_mut = unsafe { self.merge_scheduler.inner.scheduler_mut((&l).into()) }; scheduler_mut .merge_tasks .retain(|t| t.merge.id != one_merge.id); diff --git a/src/core/search/collector/early_terminating.rs b/src/core/search/collector/early_terminating.rs index 655cac6..ea3353a 100644 --- a/src/core/search/collector/early_terminating.rs +++ b/src/core/search/collector/early_terminating.rs @@ -19,10 +19,10 @@ use core::search::scorer::Scorer; use core::util::external::Volatile; use core::util::DocId; use error::{ErrorKind, Result}; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; pub struct EarlyTerminatingSortingCollector { - early_terminated: Arc>, + early_terminated: Arc>>, num_docs_to_collect_per_reader: usize, num_docs_collected_per_reader: usize, } @@ -36,14 +36,14 @@ impl EarlyTerminatingSortingCollector { ); EarlyTerminatingSortingCollector { - early_terminated: Arc::new(Volatile::new(false)), + early_terminated: Arc::new(Mutex::new(Volatile::new(false))), num_docs_to_collect_per_reader, num_docs_collected_per_reader: 0, } } pub fn early_terminated(&self) -> bool { - self.early_terminated.read() + self.early_terminated.lock().unwrap().read() } } @@ -80,7 +80,7 @@ impl Collector for EarlyTerminatingSortingCollector { self.num_docs_collected_per_reader += 1; if self.num_docs_collected_per_reader > self.num_docs_to_collect_per_reader { - self.early_terminated.write(true); + self.early_terminated.lock().unwrap().write(true); bail!(ErrorKind::Collector( collector::ErrorKind::LeafCollectionTerminated, )) @@ -104,7 +104,7 @@ impl Collector for EarlyTerminatingSortingCollector { /// However the total of hit count will be vastly underestimated since not all matching documents /// will have been collected. pub struct EarlyTerminatingLeafCollector { - early_terminated: Arc>, + early_terminated: Arc>>, num_docs_to_collect: usize, num_docs_collected: usize, } @@ -112,7 +112,7 @@ pub struct EarlyTerminatingLeafCollector { impl EarlyTerminatingLeafCollector { pub fn new( num_docs_to_collect: usize, - early_terminated: Arc>, + early_terminated: Arc>>, ) -> EarlyTerminatingLeafCollector { EarlyTerminatingLeafCollector { early_terminated, @@ -122,7 +122,7 @@ impl EarlyTerminatingLeafCollector { } pub fn early_terminated(&self) -> bool { - self.early_terminated.read() + self.early_terminated.lock().unwrap().read() } } @@ -141,7 +141,7 @@ impl Collector for EarlyTerminatingLeafCollector { self.num_docs_collected += 1; if self.num_docs_collected > self.num_docs_to_collect { - self.early_terminated.write(true); + self.early_terminated.lock().unwrap().write(true); bail!(ErrorKind::Collector( collector::ErrorKind::LeafCollectionTerminated, )) diff --git a/src/core/search/collector/timeout.rs b/src/core/search/collector/timeout.rs index 0a29702..6d53ce8 100644 --- a/src/core/search/collector/timeout.rs +++ b/src/core/search/collector/timeout.rs @@ -19,7 +19,7 @@ use core::search::scorer::Scorer; use core::util::external::Volatile; use core::util::DocId; use error::{ErrorKind, Result}; -use std::sync::Arc; +use std::sync::{Arc, Mutex}; use std::time::{Duration, SystemTime}; /// the `TimeoutCollector` collector is used to timeout search requests that @@ -34,7 +34,7 @@ use std::time::{Duration, SystemTime}; pub struct TimeoutCollector { timeout_duration: Duration, start_time: SystemTime, - timeout: Arc>, + timeout: Arc>>, } impl TimeoutCollector { @@ -42,12 +42,12 @@ impl TimeoutCollector { TimeoutCollector { timeout_duration, start_time, - timeout: Arc::new(Volatile::new(false)), + timeout: Arc::new(Mutex::new(Volatile::new(false))), } } pub fn timeout(&self) -> bool { - self.timeout.read() + self.timeout.lock().unwrap().read() } } @@ -86,7 +86,7 @@ impl Collector for TimeoutCollector { fn collect(&mut self, _doc: DocId, _scorer: &mut S) -> Result<()> { let now = SystemTime::now(); if self.start_time < now && now.duration_since(self.start_time)? >= self.timeout_duration { - self.timeout.write(true); + self.timeout.lock().unwrap().write(true); bail!(ErrorKind::Collector( collector::ErrorKind::CollectionTimeout, )) @@ -98,14 +98,14 @@ impl Collector for TimeoutCollector { pub struct TimeoutLeafCollector { timeout_duration: Duration, start_time: SystemTime, - timeout: Arc>, + timeout: Arc>>, } impl TimeoutLeafCollector { pub fn new( timeout_duration: Duration, start_time: SystemTime, - timeout: Arc>, + timeout: Arc>>, ) -> TimeoutLeafCollector { TimeoutLeafCollector { timeout_duration, @@ -123,7 +123,7 @@ impl Collector for TimeoutLeafCollector { fn collect(&mut self, _doc: i32, _scorer: &mut S) -> Result<()> { let now = SystemTime::now(); if self.start_time < now && now.duration_since(self.start_time)? >= self.timeout_duration { - self.timeout.write(true); + self.timeout.lock().unwrap().write(true); bail!(ErrorKind::Collector( collector::ErrorKind::CollectionTerminated, )) diff --git a/src/core/util/external/volatile.rs b/src/core/util/external/volatile.rs index 0607a49..36fffcb 100644 --- a/src/core/util/external/volatile.rs +++ b/src/core/util/external/volatile.rs @@ -53,7 +53,7 @@ //! and then perform operations on the pointer as usual in a volatile way. This method works as all //! of the volatile wrapper types are the same size as their contained values. -use std::ptr; +use std::{cell::UnsafeCell, ptr}; /// A wrapper type around a volatile variable, which allows for volatile reads and writes /// to the contained value. The stored type needs to be `Copy`, as volatile reads and writes @@ -62,7 +62,7 @@ use std::ptr; /// The size of this struct is the same as the size of the contained type. #[derive(Debug)] #[repr(transparent)] -pub struct Volatile(T); +pub struct Volatile(UnsafeCell); impl Volatile { /// Construct a new volatile instance wrapping the given value. @@ -78,7 +78,7 @@ impl Volatile { /// This method never panics. #[cfg(not(feature = "const_fn"))] pub fn new(value: T) -> Volatile { - Volatile(value) + Volatile(value.into()) } /// Performs a volatile read of the contained value, returning a copy @@ -89,7 +89,7 @@ impl Volatile { /// This method never panics. pub fn read(&self) -> T { // UNSAFE: Safe, as we know that our internal value exists. - unsafe { ptr::read_volatile(&self.0) } + unsafe { ptr::read_volatile(self.0.get() as *const T) } } /// Performs a volatile write, setting the contained value to the given value `value`. Volatile @@ -104,7 +104,7 @@ impl Volatile { /// else we need to use Atomic instead pub fn write(&self, value: T) { // UNSAFE: Safe, as we know that our internal value exists. - unsafe { ptr::write_volatile(&self.0 as *const T as *mut T, value) }; + unsafe { ptr::write_volatile(self.0.get() as *const T as *mut T, value) }; } /// Performs a volatile read of the contained value, passes a mutable reference to it to the @@ -124,6 +124,6 @@ impl Volatile { impl Clone for Volatile { fn clone(&self) -> Self { - Volatile(self.read()) + Volatile(self.read().into()) } } From 1838d0c80371d1a90709b0392c5b1a454e028df8 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Wed, 7 Feb 2024 02:16:11 +0000 Subject: [PATCH 05/12] Fixing merge scheduler Signed-off-by: Harsha Vamsi Kalluri --- src/core/index/merge/merge_scheduler.rs | 309 ++++++++++++------------ 1 file changed, 151 insertions(+), 158 deletions(-) diff --git a/src/core/index/merge/merge_scheduler.rs b/src/core/index/merge/merge_scheduler.rs index 9744eb8..c7e520a 100644 --- a/src/core/index/merge/merge_scheduler.rs +++ b/src/core/index/merge/merge_scheduler.rs @@ -17,7 +17,6 @@ use core::index::merge::{MergePolicy, MergerTrigger, OneMerge, OneMergeScheduleI use core::index::writer::IndexWriter; use core::store::directory::Directory; use core::store::RateLimiter; -use std::borrow::BorrowMut; use std::cell::UnsafeCell; use error::{Error, ErrorKind, Result}; @@ -158,22 +157,21 @@ impl ConcurrentMergeScheduler { } Self { inner: Arc::new(Mutex::new(ConcurrentMergeSchedulerInner::new( - max_thread_count), - )), + max_thread_count, + ))), } } } struct ConcurrentMergeSchedulerInner { - lock: UnsafeCell>, - cond: UnsafeCell, - merge_tasks: UnsafeCell>, - max_merge_count: UnsafeCell, - max_thread_count: UnsafeCell, - merge_thread_count: UnsafeCell, - target_mb_per_sec: UnsafeCell, - do_auto_io_throttle: UnsafeCell, - force_merge_mb_per_sec: UnsafeCell, + cond: Condvar, + merge_tasks: Vec, + max_merge_count: usize, + max_thread_count: usize, + merge_thread_count: usize, + target_mb_per_sec: f64, + do_auto_io_throttle: bool, + force_merge_mb_per_sec: f64, } // Floor for IO write rate limit (we will never go any lower than this) @@ -195,33 +193,41 @@ pub const MAX_MERGING_COUNT: usize = 5; impl ConcurrentMergeSchedulerInner { fn new(max_thread_count: usize) -> Self { ConcurrentMergeSchedulerInner { - lock: UnsafeCell::new(Mutex::new(())), - cond: UnsafeCell::new(Condvar::new()), - merge_tasks: UnsafeCell::new(vec![]), - max_merge_count: UnsafeCell::new(max_thread_count.max(MAX_MERGING_COUNT)), - max_thread_count: UnsafeCell::new(max_thread_count), - merge_thread_count: UnsafeCell::new(0), - target_mb_per_sec: UnsafeCell::new(START_MB_PER_SEC), - do_auto_io_throttle: UnsafeCell::new(true), - force_merge_mb_per_sec: UnsafeCell::new(f64::INFINITY), + cond: Condvar::new(), + merge_tasks: vec![], + max_merge_count: max_thread_count.max(MAX_MERGING_COUNT), + max_thread_count, + merge_thread_count: 0, + target_mb_per_sec: START_MB_PER_SEC, + do_auto_io_throttle: true, + force_merge_mb_per_sec: f64::INFINITY, } } + unsafe fn get_self( + ptr: &UnsafeCell, + ) -> &mut ConcurrentMergeSchedulerInner { + unsafe { &mut *ptr.get() } + } + #[allow(clippy::mut_from_ref)] unsafe fn scheduler_mut( &self, - _guard: UnsafeCell<&MutexGuard<()>>, + _guard: &MutexGuard<(ConcurrentMergeSchedulerInner)>, ) -> &mut ConcurrentMergeSchedulerInner { - let scheduler = - self as *const ConcurrentMergeSchedulerInner as *mut ConcurrentMergeSchedulerInner; - unsafe { &mut *scheduler } + let t = self as *const ConcurrentMergeSchedulerInner as *mut ConcurrentMergeSchedulerInner + as *const UnsafeCell; + unsafe { + let scheduler = ConcurrentMergeSchedulerInner::get_self(t.as_ref().unwrap()); + &mut *scheduler + } } fn maybe_stall<'a, D, C, MP>( &self, writer: &IndexWriter, - guard: MutexGuard<'a, ()>, - ) -> (bool, MutexGuard<'a, ()>) + guard: MutexGuard<'a, ConcurrentMergeSchedulerInner>, + ) -> (bool, MutexGuard<'a, ConcurrentMergeSchedulerInner>) where D: Directory + Send + Sync + 'static, C: Codec, @@ -229,93 +235,81 @@ impl ConcurrentMergeSchedulerInner { { let thread_id = thread::current().id(); let mut guard = guard; - unsafe { - while writer.has_pending_merges() && self.merge_thread_count() >= *self.max_merge_count.get() { - // This means merging has fallen too far behind: we - // have already created maxMergeCount threads, and - // now there's at least one more merge pending. - // Note that only maxThreadCount of - // those created merge threads will actually be - // running; the rest will be paused (see - // updateMergeThreads). We stall this producer - // thread to prevent creation of new segments, - // until merging has caught up: - if self.merge_tasks.get_mut().iter().any(|t| t.thread_id == thread_id) { - // Never stall a merge thread since this blocks the thread from - // finishing and calling updateMergeThreads, and blocking it - // accomplishes nothing anyway (it's not really a segment producer): - return (false, guard); - } - - // Defensively wait for only .25 seconds in case we are missing a .notify/All - // somewhere: - let (g, _) = *self - .cond - .get() - .wait_timeout(guard, Duration::from_millis(25)) - .unwrap(); - guard = g; + while writer.has_pending_merges() && self.merge_thread_count() >= self.max_merge_count { + // This means merging has fallen too far behind: we + // have already created maxMergeCount threads, and + // now there's at least one more merge pending. + // Note that only maxThreadCount of + // those created merge threads will actually be + // running; the rest will be paused (see + // updateMergeThreads). We stall this producer + // thread to prevent creation of new segments, + // until merging has caught up: + if self.merge_tasks.iter().any(|t| t.thread_id == thread_id) { + // Never stall a merge thread since this blocks the thread from + // finishing and calling updateMergeThreads, and blocking it + // accomplishes nothing anyway (it's not really a segment producer): + return (false, guard); } + + // Defensively wait for only .25 seconds in case we are missing a .notify/All somewhere: + let (g, _) = self + .cond + .wait_timeout(guard, Duration::from_millis(25)) + .unwrap(); + guard = g; } (true, guard) } fn update_merge_threads(&mut self) { - unsafe { - let mut active_tasks: Vec = self.merge_tasks.get_mut().iter().collect(); - active_tasks.sort(); - - let tasks_count = active_tasks.len(); - - let mut big_merge_count = 0; - for i in 0..tasks_count { - if active_tasks[tasks_count - 1 - i] - .merge - .estimated_merge_bytes - .read() as f64 - > MIN_BIG_MERGE_MB * 1024.0 * 1024.0 - { - big_merge_count = tasks_count - i; - break; - } + let mut active_tasks: Vec<_> = self.merge_tasks.iter().collect(); + active_tasks.sort(); + + let tasks_count = active_tasks.len(); + + let mut big_merge_count = 0; + for i in 0..tasks_count { + if active_tasks[tasks_count - 1 - i] + .merge + .estimated_merge_bytes + .read() as f64 + > MIN_BIG_MERGE_MB * 1024.0 * 1024.0 + { + big_merge_count = tasks_count - i; + break; } + } - for (idx, task) in active_tasks.iter().enumerate() { - // pause the thread if max_thread_count is smaller than the number of merge threads. - let do_pause = idx + self.max_thread_count < big_merge_count; - unsafe - - let new_mb_per_sec = if do_pause { - 0.0 - } else if task.merge.max_num_segments.get().is_some() { - self.force_merge_mb_per_sec - } else if !self.do_auto_io_throttle.get() - || ((task.merge.estimated_merge_bytes.read() as f64) - < MIN_BIG_MERGE_MB * 1024.0 * 1024.0) - { - f64::INFINITY - } else { - self.target_mb_per_sec.get() - }; + for (idx, task) in active_tasks.iter().enumerate() { + // pause the thread if max_thread_count is smaller than the number of merge threads. + let do_pause = idx + self.max_thread_count < big_merge_count; + + let new_mb_per_sec = if do_pause { + 0.0 + } else if task.merge.max_num_segments.get().is_some() { + self.force_merge_mb_per_sec + } else if !self.do_auto_io_throttle + || ((task.merge.estimated_merge_bytes.read() as f64) + < MIN_BIG_MERGE_MB * 1024.0 * 1024.0) + { + f64::INFINITY + } else { + self.target_mb_per_sec + }; - task.merge.rate_limiter.set_mb_per_sec(new_mb_per_sec); - } + task.merge.rate_limiter.set_mb_per_sec(new_mb_per_sec); } } fn merge_thread_count(&self) -> usize { let current_thread = thread::current().id(); - unsafe { - self.merge_tasks - .get_mut() - .iter() - .filter(|t| { - t.thread_id != current_thread - && t.thread_alive() - && !t.merge.rate_limiter.aborted() - }) - .count() - } + self.merge_tasks + .iter() + .filter(|t| { + t.thread_id != current_thread && t.thread_alive() && !t.merge.rate_limiter.aborted() + }) + .count() } fn update_io_throttle( @@ -395,7 +389,6 @@ impl ConcurrentMergeSchedulerInner { } } } - false } } @@ -412,62 +405,63 @@ impl MergeScheduler for ConcurrentMergeScheduler { C: Codec, MP: MergePolicy, { - let mut guard = self.inner.lock.lock().unwrap(); - let t = - guard.borrow_mut() as *mut MutexGuard<'_, ()> as *const UnsafeCell<&MutexGuard<'_, ()>>; - let scheduler = unsafe { self.inner.scheduler_mut((&guard).into()) }; - - if trigger == MergerTrigger::Closing { - // Disable throttling on close: - scheduler.target_mb_per_sec = MAX_MERGE_MB_PER_SEC; - scheduler.update_merge_threads(); - } - - // First, quickly run through the newly proposed merges - // and add any orthogonal merges (ie a merge not - // involving segments already pending to be merged) to - // the queue. If we are way behind on merging, many of - // these newly proposed merges will likely already be - // registered. + unsafe { + let mut guard = self.inner.lock().unwrap(); + let lock = self.inner.lock().unwrap(); + let scheduler = lock.scheduler_mut(&guard); - loop { - let (valid, g) = scheduler.maybe_stall(writer, guard); - guard = g; - if !valid { - break; + if trigger == MergerTrigger::Closing { + // Disable throttling on close: + scheduler.target_mb_per_sec = MAX_MERGE_MB_PER_SEC; + scheduler.update_merge_threads(); } - if let Some(merge) = writer.next_merge() { - scheduler.update_io_throttle(&merge); - - let sentinel = Arc::new(ThreadSentinel); - let live_sentinel = Arc::downgrade(&sentinel); - let merge_thread = MergeThread { - index_writer: writer.clone(), - merge_scheduler: self.clone(), - _live_sentinel: sentinel, - }; - let merge_info = merge.schedule_info(); - let handler = thread::Builder::new() - .name(format!( - "Rucene Merge Thread #{}", - scheduler.merge_thread_count - )) - .spawn(move || { - merge_thread.merge(merge); - }) - .expect("failed to spawn thread"); - scheduler.merge_thread_count += 1; - - let merge_task = MergeTaskInfo { - merge: merge_info, - thread_id: handler.thread().id(), - live_sentinel, - }; - scheduler.merge_tasks.push(merge_task); - scheduler.update_merge_threads(); - } else { - return Ok(()); + // First, quickly run through the newly proposed merges + // and add any orthogonal merges (ie a merge not + // involving segments already pending to be merged) to + // the queue. If we are way behind on merging, many of + // these newly proposed merges will likely already be + // registered. + + loop { + let (valid, g) = scheduler.maybe_stall(writer, guard); + guard = g; + if !valid { + break; + } + + if let Some(merge) = writer.next_merge() { + scheduler.update_io_throttle(&merge); + + let sentinel = Arc::new(ThreadSentinel); + let live_sentinel = Arc::downgrade(&sentinel); + let merge_thread = MergeThread { + index_writer: writer.clone(), + merge_scheduler: self.clone(), + _live_sentinel: sentinel, + }; + let merge_info = merge.schedule_info(); + let handler = thread::Builder::new() + .name(format!( + "Rucene Merge Thread #{}", + scheduler.merge_thread_count + )) + .spawn(move || { + merge_thread.merge(merge); + }) + .expect("failed to spawn thread"); + scheduler.merge_thread_count += 1; + + let merge_task = MergeTaskInfo { + merge: merge_info, + thread_id: handler.thread().id(), + live_sentinel, + }; + scheduler.merge_tasks.push(merge_task); + scheduler.update_merge_threads(); + } else { + return Ok(()); + } } } Ok(()) @@ -481,7 +475,7 @@ impl MergeScheduler for ConcurrentMergeScheduler { } fn merging_thread_count(&self) -> Option { - Some(self.inner.merge_thread_count()) + Some(self.inner.lock().unwrap().merge_thread_count()) } } @@ -510,9 +504,8 @@ impl MergeThrea } Ok(()) => {} } - let mut l = self.merge_scheduler.inner.lock.lock().unwrap(); - let t = l.borrow_mut() as *mut MutexGuard<'_, ()> as *const UnsafeCell<&MutexGuard<'_, ()>>; - let scheduler_mut = unsafe { self.merge_scheduler.inner.scheduler_mut((&l).into()) }; + let l = self.merge_scheduler.inner.lock().unwrap(); + let scheduler_mut = unsafe { l.scheduler_mut(&l) }; scheduler_mut .merge_tasks .retain(|t| t.merge.id != one_merge.id); From 1c999ec09bd7bc4ba66a5180ff5cc012fdf4ac82 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Thu, 8 Feb 2024 19:42:52 +0000 Subject: [PATCH 06/12] Fixing flush control Signed-off-by: Harsha Vamsi Kalluri --- src/core/index/writer/flush_control.rs | 15 +++++++++++++-- src/core/index/writer/index_writer.rs | 14 ++++++++++++-- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/core/index/writer/flush_control.rs b/src/core/index/writer/flush_control.rs index 599bae4..5f109b4 100644 --- a/src/core/index/writer/flush_control.rs +++ b/src/core/index/writer/flush_control.rs @@ -19,6 +19,7 @@ use core::index::writer::{ }; use core::util::external::Volatile; use error::Result; +use std::cell::UnsafeCell; use core::store::directory::Directory; use std::collections::{HashMap, VecDeque}; @@ -101,14 +102,24 @@ impl>, + ) -> &mut DocumentsWriterFlushControl { + unsafe { &mut *ptr.get() } + } + #[allow(clippy::mut_from_ref)] unsafe fn flush_control_mut( &self, _l: &MutexGuard, ) -> &mut DocumentsWriterFlushControl { let control = self as *const DocumentsWriterFlushControl - as *mut DocumentsWriterFlushControl; - &mut *control + as *mut DocumentsWriterFlushControl + as *const UnsafeCell>; + unsafe { + let s = DocumentsWriterFlushControl::get_self(control.as_ref().unwrap()); + &mut *s + } } pub fn do_after_document( diff --git a/src/core/index/writer/index_writer.rs b/src/core/index/writer/index_writer.rs index 76f815f..dca2354 100644 --- a/src/core/index/writer/index_writer.rs +++ b/src/core/index/writer/index_writer.rs @@ -43,6 +43,7 @@ use core::util::to_base36; use core::util::{BitsRef, DerefWrapper, DocId, VERSION_LATEST}; use core::index::ErrorKind::MergeAborted; +use std::cell::UnsafeCell; use error::ErrorKind::{AlreadyClosed, IllegalArgument, IllegalState, Index, RuntimeError}; use error::{Error, Result}; @@ -1061,11 +1062,20 @@ where }) } + unsafe fn get_self( + ptr: &UnsafeCell>, + ) -> &mut IndexWriterInner { + unsafe { &mut *ptr.get() } + } + #[allow(clippy::mut_from_ref)] unsafe fn writer_mut(&self, _l: &MutexGuard<()>) -> &mut IndexWriterInner { let writer = - self as *const IndexWriterInner as *mut IndexWriterInner; - &mut *writer + self as *const IndexWriterInner as *mut IndexWriterInner as *const UnsafeCell>; + unsafe { + let s = IndexWriterInner::get_self(writer.as_ref().unwrap()); + &mut *s + } } fn get_reader( From d6769df09685ddf95eeceda13a19a0051520a758 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Thu, 8 Feb 2024 20:07:28 +0000 Subject: [PATCH 07/12] Fixing for_util Signed-off-by: Harsha Vamsi Kalluri --- src/core/codec/postings/for_util.rs | 36 +++++++++++-------- src/core/index/writer/bufferd_updates.rs | 12 +++++-- src/core/index/writer/doc_writer.rs | 14 ++++++-- .../index/writer/doc_writer_per_thread.rs | 15 ++++++-- 4 files changed, 56 insertions(+), 21 deletions(-) diff --git a/src/core/codec/postings/for_util.rs b/src/core/codec/postings/for_util.rs index 866fa4a..f57d1e7 100644 --- a/src/core/codec/postings/for_util.rs +++ b/src/core/codec/postings/for_util.rs @@ -11,6 +11,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +use std::cell::UnsafeCell; use std::cmp::max; use std::sync::{Arc, Once}; @@ -72,10 +73,7 @@ pub fn max_data_size() -> usize { let iterations = compute_iterations(&decoder) as usize; max_data_size = max(max_data_size, iterations * decoder.byte_value_count()); } else { - panic!( - "get_decoder({:?},{:?},{:?}) failed.", - format, version, bpv - ); + panic!("get_decoder({:?},{:?},{:?}) failed.", format, version, bpv); } } let format = Format::PackedSingleBlock; @@ -84,10 +82,7 @@ pub fn max_data_size() -> usize { let iterations = compute_iterations(&decoder) as usize; max_data_size = max(max_data_size, iterations * decoder.byte_value_count()); } else { - panic!( - "get_decoder({:?},{:?},{:?}) failed.", - format, version, bpv - ); + panic!("get_decoder({:?},{:?},{:?}) failed.", format, version, bpv); } } } @@ -132,8 +127,10 @@ impl ForUtilInstance { let format = Format::with_id(format_id); encoded_sizes[bpv] = encoded_size(format, packed_ints_version, bits_per_value); unsafe { - decoders.assume_init_mut()[bpv] = get_decoder(format, packed_ints_version, bits_per_value)?; - encoders.assume_init_mut()[bpv] = get_encoder(format, packed_ints_version, bits_per_value)?; + decoders.assume_init_mut()[bpv] = + get_decoder(format, packed_ints_version, bits_per_value)?; + encoders.assume_init_mut()[bpv] = + get_encoder(format, packed_ints_version, bits_per_value)?; iterations[bpv] = compute_iterations(&decoders.assume_init_ref()[bpv]); } } @@ -168,8 +165,10 @@ impl ForUtilInstance { debug_assert!(bits_per_value <= 32); encoded_sizes[bpv - 1] = encoded_size(format, VERSION_CURRENT, bits_per_value); unsafe { - decoders.assume_init_mut()[bpv - 1] = get_decoder(format, VERSION_CURRENT, bits_per_value)?; - encoders.assume_init_mut()[bpv - 1] = get_encoder(format, VERSION_CURRENT, bits_per_value)?; + decoders.assume_init_mut()[bpv - 1] = + get_decoder(format, VERSION_CURRENT, bits_per_value)?; + encoders.assume_init_mut()[bpv - 1] = + get_encoder(format, VERSION_CURRENT, bits_per_value)?; iterations[bpv - 1] = compute_iterations(&decoders.assume_init_ref()[bpv - 1]); } @@ -334,6 +333,12 @@ impl ForUtil { self.instance.read_block_by_simd(input, decoder) } + unsafe fn get_self( + ptr: &UnsafeCell + ) -> &mut EliasFanoEncoder { + unsafe { &mut *ptr.get() } + } + pub fn read_other_encode_block( doc_in: &mut dyn IndexInput, ef_decoder: &mut Option, @@ -346,9 +351,12 @@ impl ForUtil { let upper_bound = doc_in.read_vlong()?; if ef_decoder.is_some() { let encoder = unsafe { - &mut *(ef_decoder.as_mut().unwrap().get_encoder().as_ref() + let s = + ef_decoder.as_mut().unwrap().get_encoder().as_ref() as *const EliasFanoEncoder - as *mut EliasFanoEncoder) + as *mut EliasFanoEncoder as *const UnsafeCell; + let t = ForUtil::get_self(s.as_ref().unwrap()); + &mut *t }; encoder.rebuild_not_with_check(BLOCK_SIZE as i64, upper_bound)?; encoder.deserialize2(doc_in)?; diff --git a/src/core/index/writer/bufferd_updates.rs b/src/core/index/writer/bufferd_updates.rs index 67a2fc6..c240ee6 100644 --- a/src/core/index/writer/bufferd_updates.rs +++ b/src/core/index/writer/bufferd_updates.rs @@ -30,6 +30,7 @@ use core::store::directory::Directory; use core::store::IOContext; use core::util::DocId; +use std::cell::UnsafeCell; use std::cmp::{min, Ordering as CmpOrdering}; use std::collections::{BinaryHeap, HashMap}; use std::fmt; @@ -362,6 +363,12 @@ impl BufferedUpdatesStream { self.num_terms.load(Ordering::Acquire) } + unsafe fn get_self( + ptr: &UnsafeCell>, + ) -> &mut BufferedUpdatesStream { + unsafe { &mut *ptr.get() } + } + pub fn apply_deletes_and_updates( &self, pool: &ReaderPool, @@ -374,8 +381,9 @@ impl BufferedUpdatesStream { { let _l = self.lock.lock().unwrap(); let updates_stream = unsafe { - let stream = self as *const BufferedUpdatesStream as *mut BufferedUpdatesStream; - &mut *stream + let stream = self as *const BufferedUpdatesStream as *mut BufferedUpdatesStream as *const UnsafeCell>; + let s = BufferedUpdatesStream::get_self(stream.as_ref().unwrap()); + &mut *s }; let mut seg_states = Vec::with_capacity(infos.len()); let gen = self.next_gen.load(Ordering::Acquire); diff --git a/src/core/index/writer/doc_writer.rs b/src/core/index/writer/doc_writer.rs index 9dfe250..7591ee6 100644 --- a/src/core/index/writer/doc_writer.rs +++ b/src/core/index/writer/doc_writer.rs @@ -23,6 +23,7 @@ use core::index::writer::{ use core::search::query::Query; use core::store::directory::{Directory, LockValidatingDirectoryWrapper}; use core::util::external::Volatile; +use std::cell::UnsafeCell; use error::{ErrorKind::AlreadyClosed, ErrorKind::IllegalState, Result}; use crossbeam::queue::SegQueue; @@ -181,10 +182,19 @@ where self.index_writer.upgrade().unwrap() } + unsafe fn get_self( + ptr: &UnsafeCell>, + ) -> &mut DocumentsWriter { + unsafe { &mut *ptr.get() } + } + #[allow(clippy::mut_from_ref)] unsafe fn doc_writer_mut(&self, _l: &MutexGuard<()>) -> &mut DocumentsWriter { - let w = self as *const DocumentsWriter as *mut DocumentsWriter; - &mut *w + let w = self as *const DocumentsWriter as *mut DocumentsWriter as *const UnsafeCell>; + unsafe { + let s = DocumentsWriter::get_self(w.as_ref().unwrap()); + &mut *s + } } pub fn set_delete_queue(&self, delete_queue: Arc>) { diff --git a/src/core/index/writer/doc_writer_per_thread.rs b/src/core/index/writer/doc_writer_per_thread.rs index 3820a5b..bd9bb82 100644 --- a/src/core/index/writer/doc_writer_per_thread.rs +++ b/src/core/index/writer/doc_writer_per_thread.rs @@ -29,7 +29,7 @@ use core::{ }, }; -use std::collections::{HashMap, HashSet}; +use std::{cell::UnsafeCell, collections::{HashMap, HashSet}}; use std::sync::atomic::{AtomicBool, AtomicI64, AtomicU64, Ordering}; use std::sync::{Arc, Mutex, MutexGuard, RwLock, RwLockWriteGuard, Weak}; use std::time::SystemTime; @@ -814,13 +814,22 @@ where } } + unsafe fn get_self( + ptr: &UnsafeCell>, + ) -> &mut ThreadState { + unsafe { &mut *ptr.get() } + } + #[allow(clippy::mut_from_ref)] pub fn thread_state_mut( &self, _lock: &MutexGuard, ) -> &mut ThreadState { - let state = self as *const ThreadState as *mut ThreadState; - unsafe { &mut *state } + let state = self as *const ThreadState as *mut ThreadState as *const UnsafeCell>; + unsafe { + let s = ThreadState::get_self(state.as_ref().unwrap()); + &mut *s + } } pub fn dwpt(&self) -> &DocumentsWriterPerThread { From 3f7801b350d16c586d441d9dd3e08a2a16ce4fa7 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Fri, 9 Feb 2024 00:20:25 +0000 Subject: [PATCH 08/12] Fix remaining instances of unsafe Signed-off-by: Harsha Vamsi Kalluri --- src/core/codec/field_infos/mod.rs | 15 ++++++++---- src/core/codec/segment_infos/mod.rs | 7 ++++++ src/core/index/writer/index_writer.rs | 34 +++++++++++++++++++++------ src/core/util/doc_id_set.rs | 11 +++++++-- 4 files changed, 54 insertions(+), 13 deletions(-) diff --git a/src/core/codec/field_infos/mod.rs b/src/core/codec/field_infos/mod.rs index a5ac2d8..e896409 100644 --- a/src/core/codec/field_infos/mod.rs +++ b/src/core/codec/field_infos/mod.rs @@ -18,6 +18,7 @@ pub use self::field_infos_format::*; use error::ErrorKind::{IllegalArgument, IllegalState}; use error::Result; +use std::cell::UnsafeCell; use std::cmp::max; use std::collections::hash_map::Entry; use std::collections::{BTreeMap, HashMap}; @@ -108,6 +109,12 @@ impl FieldInfo { Ok(info) } + pub unsafe fn get_self( + ptr: &UnsafeCell, + ) -> &mut FieldInfo { + unsafe { &mut *ptr.get() } + } + pub fn check_consistency(&self) -> Result<()> { if let IndexOptions::Null = self.index_options { if self.has_store_term_vector { @@ -324,10 +331,10 @@ pub struct FieldInvertState { // we must track these across field instances (multi-valued case) pub last_start_offset: i32, pub last_position: i32, - /* pub offset_attribute: OffsetAttribute, - * pub pos_incr_attribute: PositionIncrementAttribute, - * pub payload_attribute: PayloadAttribute, - * term_attribute: TermToBytesRefAttribute, */ + // pub offset_attribute: OffsetAttribute, + // pub pos_incr_attribute: PositionIncrementAttribute, + // pub payload_attribute: PayloadAttribute, + // term_attribute: TermToBytesRefAttribute, } impl FieldInvertState { diff --git a/src/core/codec/segment_infos/mod.rs b/src/core/codec/segment_infos/mod.rs index 2803616..aab2965 100644 --- a/src/core/codec/segment_infos/mod.rs +++ b/src/core/codec/segment_infos/mod.rs @@ -21,6 +21,7 @@ pub use self::segment_infos_format::*; use serde::ser::SerializeStruct; use serde::{Serialize, Serializer}; +use std::cell::UnsafeCell; use std::collections::{HashMap, HashSet}; use std::fmt; use std::hash::{Hash, Hasher}; @@ -424,6 +425,12 @@ impl SegmentCommitInfo { } } + pub unsafe fn get_self( + ptr: &UnsafeCell>, + ) -> &mut SegmentCommitInfo { + unsafe { &mut *ptr.get() } + } + pub fn files(&self) -> HashSet { let mut files = HashSet::new(); // Start from the wrapped info's files: diff --git a/src/core/index/writer/index_writer.rs b/src/core/index/writer/index_writer.rs index dca2354..e16c095 100644 --- a/src/core/index/writer/index_writer.rs +++ b/src/core/index/writer/index_writer.rs @@ -43,9 +43,9 @@ use core::util::to_base36; use core::util::{BitsRef, DerefWrapper, DocId, VERSION_LATEST}; use core::index::ErrorKind::MergeAborted; -use std::cell::UnsafeCell; use error::ErrorKind::{AlreadyClosed, IllegalArgument, IllegalState, Index, RuntimeError}; use error::{Error, Result}; +use std::cell::UnsafeCell; use std::collections::{HashMap, HashSet, VecDeque}; use std::mem; @@ -1070,8 +1070,9 @@ where #[allow(clippy::mut_from_ref)] unsafe fn writer_mut(&self, _l: &MutexGuard<()>) -> &mut IndexWriterInner { - let writer = - self as *const IndexWriterInner as *mut IndexWriterInner as *const UnsafeCell>; + let writer = self as *const IndexWriterInner + as *mut IndexWriterInner + as *const UnsafeCell>; unsafe { let s = IndexWriterInner::get_self(writer.as_ref().unwrap()); &mut *s @@ -4445,6 +4446,13 @@ where self.pending_dv_updates.insert(field, v); } } + + unsafe fn get_self( + ptr: &UnsafeCell>, + ) -> &mut ReadersAndUpdatesInner { + unsafe { &mut *ptr.get() } + } + // Writes field updates (new _X_N updates files) to the directory // pub fn write_field_updates(&mut self, _dir: &DW) -> Result<()> { pub fn write_field_updates(&self) -> Result { @@ -4454,8 +4462,12 @@ where } let me = unsafe { - &mut *(self as *const ReadersAndUpdatesInner - as *mut ReadersAndUpdatesInner) + let t = self as *const ReadersAndUpdatesInner + as *mut ReadersAndUpdatesInner + as *const UnsafeCell>; + let s = ReadersAndUpdatesInner::get_self(t.as_ref().unwrap()); + + &mut *s }; assert!(self.reader.is_some()); @@ -4482,7 +4494,10 @@ where let mut new_dv_files = me.handle_doc_values_updates(&mut field_infos, doc_values_format)?; let info_mut_ref = unsafe { - &mut *(info.as_ref() as *const SegmentCommitInfo as *mut SegmentCommitInfo) + let t = info.as_ref() as *const SegmentCommitInfo as *mut SegmentCommitInfo + as *const UnsafeCell>; + let s = SegmentCommitInfo::get_self(t.as_ref().unwrap()); + &mut *s }; // writeFieldInfosGen fnm if !new_dv_files.is_empty() { @@ -4540,7 +4555,12 @@ where // step1 construct segment write state let ctx = IOContext::Flush(FlushInfo::new(info.info.max_doc() as u32)); let field_info = infos.field_info_by_name(field).unwrap(); - let field_info = unsafe { &mut *(field_info as *const FieldInfo as *mut FieldInfo) }; + let field_info = unsafe { + let t = field_info as *const FieldInfo as *mut FieldInfo + as *const UnsafeCell; + let s: &mut FieldInfo = FieldInfo::get_self(t.as_ref().unwrap()); + &mut *s + }; let old_dv_gen = field_info.set_doc_values_gen(dv_gen); let state = SegmentWriteState::new( tracker.clone(), diff --git a/src/core/util/doc_id_set.rs b/src/core/util/doc_id_set.rs index 95c44aa..e8d5f59 100644 --- a/src/core/util/doc_id_set.rs +++ b/src/core/util/doc_id_set.rs @@ -17,6 +17,7 @@ use core::search::{DocIdSet, DocIterator, NO_MORE_DOCS}; use core::util::bit_set::{FixedBitSet, ImmutableBitSet}; use core::util::packed::{EliasFanoDecoder, EliasFanoEncoder, NO_MORE_VALUES}; use core::util::DocId; +use std::cell::UnsafeCell; use error::ErrorKind::*; use std::borrow::Cow; use std::sync::Arc; @@ -361,7 +362,7 @@ impl DocIterator for NotDocIterator { #[derive(Debug)] pub struct EliasFanoDocIdSet { - ef_encoder:Arc, + ef_encoder: Arc, } impl EliasFanoDocIdSet { @@ -379,9 +380,15 @@ impl EliasFanoDocIdSet { EliasFanoEncoder::sufficiently_smaller_than_bit_set(num_values, upper_bound) } + unsafe fn get_self(ptr: &UnsafeCell) -> &mut EliasFanoEncoder { + unsafe { &mut *ptr.get() } + } + pub fn encode_from_disi(&mut self, mut disi: impl DocIterator) -> Result<()> { let encoder = unsafe { - &mut *(self.ef_encoder.as_ref() as *const EliasFanoEncoder as *mut EliasFanoEncoder) + let s = self.ef_encoder.as_ref() as *const EliasFanoEncoder as *mut EliasFanoEncoder as *const UnsafeCell; + let t = EliasFanoDocIdSet::get_self(s.as_ref().unwrap()); + &mut *t }; while self.ef_encoder.num_encoded < self.ef_encoder.num_values { let x = disi.next()?; From 0d330d5e62a176a561094ec61ced4a983bc06ccb Mon Sep 17 00:00:00 2001 From: Michael Froh Date: Fri, 9 Feb 2024 02:37:35 +0000 Subject: [PATCH 09/12] Fix negative in unreachable branch in packed_simd.rs --- .gitignore | 3 +- Cargo.lock | 829 ---------------------------- src/core/util/packed/packed_simd.rs | 2 +- 3 files changed, 3 insertions(+), 831 deletions(-) delete mode 100644 Cargo.lock diff --git a/.gitignore b/.gitignore index 9f97022..2c96eb1 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -target/ \ No newline at end of file +target/ +Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 09485b8..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,829 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" -dependencies = [ - "memchr", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if 1.0.0", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "bit-set" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9bf6104718e80d7b26a68fdbacff3481cfc05df670821affc7e9cbc1884400c" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b4ff8b16e6076c3e14220b39fbc1fabb6737522281a388998046859400895f" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" - -[[package]] -name = "build_const" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ae4235e6dac0694637c763029ecea1a2ec9e4e06ec2729bd21ba4d9c863eb7" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "0.4.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] - -[[package]] -name = "cc" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" -dependencies = [ - "libc", -] - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "chan" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d14956a3dae065ffaa0d92ece848ab4ced88d32361e7fdfbfd653a5c454a1ed8" -dependencies = [ - "rand 0.3.23", -] - -[[package]] -name = "chan-signal" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b829e3f5432da0cc46577d89fc88c937e78052e6735fb47ce0213b0db120b01" -dependencies = [ - "bit-set", - "chan", - "lazy_static 0.2.11", - "libc", -] - -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "crc" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" -dependencies = [ - "build_const", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20ff29ded3204c5106278a81a38f4b482636ed4fa1e6cfbeef193291beb29ed" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils", - "lazy_static 1.4.0", - "maybe-uninit", - "memoffset", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static 1.4.0", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "either" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" - -[[package]] -name = "errno" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" -dependencies = [ - "libc", - "windows-sys", -] - -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "backtrace", - "version_check", -] - -[[package]] -name = "fasthash" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce56b715df3559085323d0a6724eccfd52994ac5abac9e9ffc6093853163f3bb" -dependencies = [ - "fasthash-sys", - "seahash", - "xoroshiro128", -] - -[[package]] -name = "fasthash-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6de941abfe2e715cdd34009d90546f850597eb69ca628ddfbf616e53dda28f8" -dependencies = [ - "gcc", -] - -[[package]] -name = "fastrand" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" - -[[package]] -name = "flate2" -version = "1.0.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - -[[package]] -name = "gcc" -version = "0.3.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" - -[[package]] -name = "gimli" -version = "0.28.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" - -[[package]] -name = "hermit-abi" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "itoa" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" - -[[package]] -name = "lazy_static" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.153" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" - -[[package]] -name = "linux-raw-sys" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" - -[[package]] -name = "log" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" - -[[package]] -name = "memmap" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2ffa2c986de11a9df78620c01eeaaf27d94d3ff02bf81bfcca953102dd0c6ff" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" -dependencies = [ - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "num-traits" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "object" -version = "0.32.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" -dependencies = [ - "memchr", -] - -[[package]] -name = "proc-macro2" -version = "1.0.78" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ac302d8f83c0c1974bf758f6b041c6c8ada916fbb44a609158ca8b064cc76c" -dependencies = [ - "libc", - "rand 0.4.6", -] - -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c618c47cd3ebd209790115ab837de41425723956ad3ce2e6a7f09890947cacb9" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "winapi", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "regex" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9329abc99e39129fcceabd24cf5d85b4671ef7c29c50e972bc5afe32438ec384" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", - "thread_local", - "utf8-ranges", -] - -[[package]] -name = "regex-syntax" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" -dependencies = [ - "ucd-util", -] - -[[package]] -name = "rucene" -version = "0.1.1" -dependencies = [ - "byteorder", - "bytes", - "chan", - "chan-signal", - "crc", - "crossbeam", - "crunchy", - "either", - "error-chain", - "fasthash", - "flate2", - "lazy_static 1.4.0", - "log", - "memmap", - "num-traits", - "num_cpus", - "rand 0.5.6", - "regex", - "serde", - "serde_derive", - "serde_json", - "smallvec", - "tempfile", - "thread_local", - "unicode_reader", -] - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustix" -version = "0.38.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" -dependencies = [ - "bitflags 2.4.2", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - -[[package]] -name = "ryu" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "seahash" -version = "3.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f57ca1d128a43733fd71d583e837b1f22239a37ebea09cde11d8d9a9080f47" - -[[package]] -name = "serde" -version = "1.0.196" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.196" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.113" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97fcaeba89edba30f044a10c6a3cc39df9c3f17d7cd829dd1446cab35f890e0" -dependencies = [ - "maybe-uninit", -] - -[[package]] -name = "syn" -version = "2.0.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tempfile" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" -dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys", -] - -[[package]] -name = "thread_local" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" -dependencies = [ - "lazy_static 1.4.0", -] - -[[package]] -name = "ucd-util" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd2fc5d32b590614af8b0a20d837f32eca055edd0bbead59a9cfe80858be003" - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "unicode-segmentation" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" - -[[package]] -name = "unicode_reader" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001b27e8f5e9da465b3584051a3a3d2ebefee4f8595c49e96cc1deec9667e4cc" -dependencies = [ - "unicode-segmentation", -] - -[[package]] -name = "utf8-ranges" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcfc827f90e53a02eaef5e535ee14266c1d569214c6aa70133a624d8a3164ba" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - -[[package]] -name = "windows-targets" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" - -[[package]] -name = "xoroshiro128" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0eeda34baec49c4f1eb2c04d59b761582fd6330010f9330ca696ca1a355dfcd" -dependencies = [ - "rand 0.4.6", -] diff --git a/src/core/util/packed/packed_simd.rs b/src/core/util/packed/packed_simd.rs index ff1e713..e2e5441 100644 --- a/src/core/util/packed/packed_simd.rs +++ b/src/core/util/packed/packed_simd.rs @@ -147,7 +147,7 @@ macro_rules! unpack_bits { _buffer, simd::_mm_slli_epi32(temp, remain)), mask); $(_buffer = $transfer($obj, _buffer);)? simd::_mm_storeu_si128(_output, _buffer); - simd::_mm_srli_epi32(temp, $num - remain) + simd::_mm_srli_epi32(temp, (32 + $num - remain) % 32) } } else { let mut _data = simd::_mm_and_si128(_buffer, mask); From 19eeeadb19fd702039c8fdbb21bc084c6320d138 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Fri, 9 Feb 2024 02:03:51 +0000 Subject: [PATCH 10/12] Fix compile error + warnings Signed-off-by: Harsha Vamsi Kalluri --- src/core/index/merge/merge_rate_limiter.rs | 4 ++-- src/core/index/merge/merge_scheduler.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/index/merge/merge_rate_limiter.rs b/src/core/index/merge/merge_rate_limiter.rs index 9937522..97ce515 100644 --- a/src/core/index/merge/merge_rate_limiter.rs +++ b/src/core/index/merge/merge_rate_limiter.rs @@ -14,12 +14,12 @@ use core::store::RateLimiter; use core::index::ErrorKind::MergeAborted; -use std::cell::UnsafeCell; + use error::{ErrorKind, Result}; use std::f64; use std::sync::atomic::{AtomicBool, AtomicU64, Ordering}; -use std::sync::{Condvar, Mutex, RwLock}; +use std::sync::{Condvar, Mutex}; use std::time::{Duration, SystemTime}; use core::util::external::Volatile; diff --git a/src/core/index/merge/merge_scheduler.rs b/src/core/index/merge/merge_scheduler.rs index c7e520a..ea58d91 100644 --- a/src/core/index/merge/merge_scheduler.rs +++ b/src/core/index/merge/merge_scheduler.rs @@ -213,7 +213,7 @@ impl ConcurrentMergeSchedulerInner { #[allow(clippy::mut_from_ref)] unsafe fn scheduler_mut( &self, - _guard: &MutexGuard<(ConcurrentMergeSchedulerInner)>, + _guard: &MutexGuard, ) -> &mut ConcurrentMergeSchedulerInner { let t = self as *const ConcurrentMergeSchedulerInner as *mut ConcurrentMergeSchedulerInner as *const UnsafeCell; From d17d03a7225c7e481b7fddfcb913713727845c2b Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Tue, 13 Feb 2024 23:16:06 +0000 Subject: [PATCH 11/12] Added new examples Signed-off-by: Harsha Vamsi Kalluri --- examples/basic_points.rs | 99 +++++++++++++++ examples/basic_points_range.rs | 150 +++++++++++++++++++++++ examples/{example.rs => basic_search.rs} | 10 +- 3 files changed, 255 insertions(+), 4 deletions(-) create mode 100644 examples/basic_points.rs create mode 100644 examples/basic_points_range.rs rename examples/{example.rs => basic_search.rs} (93%) diff --git a/examples/basic_points.rs b/examples/basic_points.rs new file mode 100644 index 0000000..d62c519 --- /dev/null +++ b/examples/basic_points.rs @@ -0,0 +1,99 @@ +extern crate rucene; + +use rucene::core::analysis::WhitespaceTokenizer; +use rucene::core::codec::doc_values::lucene54::DocValues; +use rucene::core::codec::Lucene62Codec; +use rucene::core::doc::{DocValuesType, Field, FieldType, Fieldable, IndexOptions, NumericDocValuesField, Term}; +use rucene::core::index::reader::IndexReader; +use rucene::core::index::writer::{IndexWriter, IndexWriterConfig}; +use rucene::core::search::collector::TopDocsCollector; +use rucene::core::search::query::{IntPoint, LongPoint, PointRangeQuery, Query, TermQuery}; +use rucene::core::search::{DefaultIndexSearcher, IndexSearcher}; +use rucene::core::store::directory::FSDirectory; + +use std::fs; +use std::io; +use std::path::Path; +use std::sync::Arc; + +use rucene::core::highlight::FastVectorHighlighter; +use rucene::core::highlight::FieldQuery; +use rucene::core::util::VariantValue; +use rucene::error::Result; + +fn indexed_numeric_field_type() -> FieldType { + let mut field_type = FieldType::default(); + field_type.tokenized = false; + field_type.doc_values_type = DocValuesType::Binary; + field_type.dimension_count = 1; + field_type.dimension_num_bytes = 8; + field_type +} + +fn new_index_numeric_field(field_name: String, data: i64) -> Field { + Field::new_bytes(field_name, LongPoint::pack(&[data]), indexed_numeric_field_type()) +} +fn main() -> Result<()> { + // create index directory + let path = "/tmp/test_rucene"; + let dir_path = Path::new(path); + if dir_path.exists() { + fs::remove_dir_all(&dir_path)?; + fs::create_dir(&dir_path)?; + } + + // create index writer + let config = Arc::new(IndexWriterConfig::default()); + let directory = Arc::new(FSDirectory::with_path(&dir_path)?); + let writer = IndexWriter::new(directory, config)?; + + let mut doc: Vec> = vec![]; + + let timestamp: i64 = 1707782905540; + + let numeric_field = new_index_numeric_field("timestamp".into(), timestamp); + + doc.push(Box::new(numeric_field)); + + writer.add_document(doc)?; + + // flush to disk + writer.commit()?; + + // new index search + let reader = writer.get_reader(true, false)?; + let index_searcher = DefaultIndexSearcher::new(Arc::new(reader), None); + + // search + let query= LongPoint::new_range_query( + "timestamp".into(), + 1707782905539, + 1707782905541, + )?; + + + let mut collector: TopDocsCollector = TopDocsCollector::new(10); + index_searcher.search(&*query, &mut collector)?; + + let top_docs = collector.top_docs(); + println!("total hits: {}", top_docs.total_hits()); + for d in top_docs.score_docs() { + let doc_id = d.doc_id(); + println!(" doc: {}", doc_id); + // fetch stored fields + let stored_fields = vec!["timestamp".into()]; + let stored_doc = index_searcher.reader().document(doc_id, &stored_fields)?; + if stored_doc.fields.len() > 0 { + println!(" stroed fields: "); + for s in &stored_doc.fields { + println!( + " field: {}, value: {}", + s.field.name(), + s.field.field_data().unwrap() + ); + } + } + } + + Ok(()) +} diff --git a/examples/basic_points_range.rs b/examples/basic_points_range.rs new file mode 100644 index 0000000..e9252dd --- /dev/null +++ b/examples/basic_points_range.rs @@ -0,0 +1,150 @@ +extern crate rucene; + +use rucene::core::analysis::WhitespaceTokenizer; +use rucene::core::codec::doc_values::lucene54::DocValues; +use rucene::core::codec::Lucene62Codec; +use rucene::core::doc::{ + DocValuesType, Field, FieldType, Fieldable, IndexOptions, NumericDocValuesField, Term, +}; +use rucene::core::index::reader::IndexReader; +use rucene::core::index::writer::{IndexWriter, IndexWriterConfig}; +use rucene::core::search::collector::TopDocsCollector; +use rucene::core::search::query::{self, IntPoint, LongPoint, PointRangeQuery, Query, TermQuery}; +use rucene::core::search::{DefaultIndexSearcher, IndexSearcher}; +use rucene::core::store::directory::FSDirectory; + +use std::borrow::{Borrow, BorrowMut}; +use std::fs::{self, File}; +use std::io::{self, BufRead}; +use std::iter::Sum; +use std::path::Path; +use std::sync::Arc; +use std::time::{Duration, Instant, SystemTime}; +use std::{cmp, u128}; + +use rucene::core::highlight::FastVectorHighlighter; +use rucene::core::highlight::FieldQuery; +use rucene::core::util::VariantValue; +use rucene::error::Result; + +fn indexed_numeric_field_type() -> FieldType { + let mut field_type = FieldType::default(); + field_type.tokenized = false; + field_type.doc_values_type = DocValuesType::Binary; + field_type.dimension_count = 1; + field_type.dimension_num_bytes = 8; + field_type +} + +fn new_index_numeric_field(field_name: String, data: i64) -> Field { + Field::new_bytes( + field_name, + LongPoint::pack(&[data]), + indexed_numeric_field_type(), + ) +} + +fn read_lines

(filename: P) -> io::Result>> +where + P: AsRef, +{ + let file = File::open(filename)?; + Ok(io::BufReader::new(file).lines()) +} + +fn main() -> Result<()> { + // create index directory + let path = "/tmp/test_rucene"; + let dir_path = Path::new(path); + if dir_path.exists() { + fs::remove_dir_all(&dir_path)?; + fs::create_dir(&dir_path)?; + } + + // create index writer + let config = Arc::new(IndexWriterConfig::default()); + let directory = Arc::new(FSDirectory::with_path(&dir_path)?); + let writer = IndexWriter::new(directory, config)?; + + let mut queries = vec![]; + + const BASE_TIMESTAMP: i64 = 1672531200000; + + let mut sum: u128 = 0; + let min: i64 = i64::MAX; + let max: i64 = 0; + + if let Ok(mut lines) = read_lines("../range_datapoints") { + let numDocs: &i32 = &lines.next().unwrap().unwrap().parse().unwrap(); + // Consumes the iterator, returns an (Optional) String + + for n in 0..*numDocs { + let timestamp: &i64 = &lines.next().unwrap().unwrap().parse().unwrap(); + let numeric_field = new_index_numeric_field("timestamp".into(), *timestamp); + let mut doc: Vec> = vec![]; + doc.push(Box::new(numeric_field)); + + writer.add_document(doc)?; + + if (n > 0 && n % 1000000 == 0) { + writer.commit()?; + } + } + let numQueries: &i32 = &lines.next().unwrap().unwrap().parse().unwrap(); + + for n in 0..*numQueries { + let l = lines.next().unwrap().unwrap(); + + let mut range = l.split(','); + + let lower = range.next().unwrap(); + + let lowerBound: i64 = lower.parse::().unwrap(); + + // println!("lower: {}", lowerBound); + + let upper = range.next().unwrap(); + + let upperBound: i64 = upper.parse::().unwrap(); + + // println!("upper: {}", upperBound); + + queries.push(LongPoint::new_range_query( + "timestamp".into(), + lowerBound, + upperBound, + )); + } + + let warmupCount = cmp::min(10000, queries.len()); + + // for i in 0..warmupCount { + // let query = queries.get(i).unwrap().as_ref().unwrap(); + // index_searcher.search(&**query, &mut collector); + // } + + let mut hits: u64 = 0; + + let reader = writer.get_reader(true, false)?; + let index_searcher = DefaultIndexSearcher::new(Arc::new(reader), None); + let overall_start = Instant::now(); + for iter in queries.iter() { + let mut collector = TopDocsCollector::new(10); + let query = iter.as_ref().unwrap(); + let start_time: Instant = Instant::now(); + index_searcher.search(&**query, &mut collector); + let time: Duration = Instant::now().duration_since(start_time); + hits += collector.top_docs().total_hits() as u64; + sum += time.as_nanos(); + } + println!("Total hits: {}", hits); + println!( + "Searching time: {}", + Instant::now().duration_since(overall_start).as_secs_f64() + ); + println!("Queries len: {}", queries.len()); + println!("Avg. time: {}", sum / (queries.len() as u128)); + } + + Ok(()) +} diff --git a/examples/example.rs b/examples/basic_search.rs similarity index 93% rename from examples/example.rs rename to examples/basic_search.rs index d783efd..39c4e46 100644 --- a/examples/example.rs +++ b/examples/basic_search.rs @@ -41,12 +41,14 @@ fn new_index_text_field(field_name: String, text: String) -> Field { fn new_stored_text_field(field_name: String, text: String) -> Field { let mut field_type = FieldType::default(); field_type.stored = true; - + field_type.index_options = IndexOptions::DocsAndFreqsAndPositionsAndOffsets; Field::new( field_name, field_type, Some(VariantValue::VString(text)), - None, + Some(Box::new(WhitespaceTokenizer::new(Box::new( + StringReader::new("The quick brown fox jumps over a lazy dog".into()), + )))), ) } @@ -90,9 +92,9 @@ fn main() -> Result<()> { // add indexed text field let text = "The quick brown fox jumps over a lazy dog"; let text_field = new_index_text_field("title".into(), text.into()); - doc.push(Box::new(text_field)); + // doc.push(Box::new(text_field)); // add raw text field, this used for highlight - let stored_text_field = new_stored_text_field("title.raw".into(), text.into()); + let stored_text_field = new_stored_text_field("title".into(), text.into()); doc.push(Box::new(stored_text_field)); // add numeric doc value field doc.push(Box::new(NumericDocValuesField::new("weight".into(), 1))); From 2206e5616054cbec4f85d95d7f8990bfff684397 Mon Sep 17 00:00:00 2001 From: Harsha Vamsi Kalluri Date: Fri, 16 Feb 2024 00:19:43 +0000 Subject: [PATCH 12/12] Added points range benchmark Signed-off-by: Harsha Vamsi Kalluri --- Cargo.toml | 4 +- examples/basic_points.rs | 11 +- examples/basic_points_range.rs | 77 ++- examples/basic_search.rs | 38 +- flamegraph.svg | 491 ++++++++++++++++++ .../postings/blocktree/blocktree_reader.rs | 45 +- src/core/util/external/thread_pool.rs | 2 +- 7 files changed, 568 insertions(+), 100 deletions(-) create mode 100644 flamegraph.svg diff --git a/Cargo.toml b/Cargo.toml index 7a50f83..63e4967 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,4 +41,6 @@ tempfile = "3.0.8" # The release profile, used for `cargo build --release` [profile.release] -debug = true +opt-level = 3 +debug = false +debug-assertions = false \ No newline at end of file diff --git a/examples/basic_points.rs b/examples/basic_points.rs index d62c519..7b2ab47 100644 --- a/examples/basic_points.rs +++ b/examples/basic_points.rs @@ -1,24 +1,17 @@ extern crate rucene; -use rucene::core::analysis::WhitespaceTokenizer; -use rucene::core::codec::doc_values::lucene54::DocValues; -use rucene::core::codec::Lucene62Codec; -use rucene::core::doc::{DocValuesType, Field, FieldType, Fieldable, IndexOptions, NumericDocValuesField, Term}; +use rucene::core::doc::{DocValuesType, Field, FieldType, Fieldable}; use rucene::core::index::reader::IndexReader; use rucene::core::index::writer::{IndexWriter, IndexWriterConfig}; use rucene::core::search::collector::TopDocsCollector; -use rucene::core::search::query::{IntPoint, LongPoint, PointRangeQuery, Query, TermQuery}; +use rucene::core::search::query::LongPoint; use rucene::core::search::{DefaultIndexSearcher, IndexSearcher}; use rucene::core::store::directory::FSDirectory; use std::fs; -use std::io; use std::path::Path; use std::sync::Arc; -use rucene::core::highlight::FastVectorHighlighter; -use rucene::core::highlight::FieldQuery; -use rucene::core::util::VariantValue; use rucene::error::Result; fn indexed_numeric_field_type() -> FieldType { diff --git a/examples/basic_points_range.rs b/examples/basic_points_range.rs index e9252dd..4d7a4cc 100644 --- a/examples/basic_points_range.rs +++ b/examples/basic_points_range.rs @@ -1,30 +1,19 @@ extern crate rucene; -use rucene::core::analysis::WhitespaceTokenizer; -use rucene::core::codec::doc_values::lucene54::DocValues; -use rucene::core::codec::Lucene62Codec; -use rucene::core::doc::{ - DocValuesType, Field, FieldType, Fieldable, IndexOptions, NumericDocValuesField, Term, -}; -use rucene::core::index::reader::IndexReader; +use rucene::core::doc::{DocValuesType, Field, FieldType, Fieldable}; use rucene::core::index::writer::{IndexWriter, IndexWriterConfig}; use rucene::core::search::collector::TopDocsCollector; -use rucene::core::search::query::{self, IntPoint, LongPoint, PointRangeQuery, Query, TermQuery}; +use rucene::core::search::query::LongPoint; use rucene::core::search::{DefaultIndexSearcher, IndexSearcher}; use rucene::core::store::directory::FSDirectory; -use std::borrow::{Borrow, BorrowMut}; +use std::cmp; use std::fs::{self, File}; use std::io::{self, BufRead}; -use std::iter::Sum; use std::path::Path; use std::sync::Arc; -use std::time::{Duration, Instant, SystemTime}; -use std::{cmp, u128}; +use std::time::{Duration, Instant}; -use rucene::core::highlight::FastVectorHighlighter; -use rucene::core::highlight::FieldQuery; -use rucene::core::util::VariantValue; use rucene::error::Result; fn indexed_numeric_field_type() -> FieldType { @@ -56,10 +45,10 @@ fn main() -> Result<()> { // create index directory let path = "/tmp/test_rucene"; let dir_path = Path::new(path); - if dir_path.exists() { - fs::remove_dir_all(&dir_path)?; - fs::create_dir(&dir_path)?; - } + // if dir_path.exists() { + // fs::remove_dir_all(&dir_path)?; + // fs::create_dir(&dir_path)?; + // } // create index writer let config = Arc::new(IndexWriterConfig::default()); @@ -68,75 +57,69 @@ fn main() -> Result<()> { let mut queries = vec![]; - const BASE_TIMESTAMP: i64 = 1672531200000; - let mut sum: u128 = 0; - let min: i64 = i64::MAX; - let max: i64 = 0; if let Ok(mut lines) = read_lines("../range_datapoints") { - let numDocs: &i32 = &lines.next().unwrap().unwrap().parse().unwrap(); + let num_docs: &i32 = &lines.next().unwrap().unwrap().parse().unwrap(); // Consumes the iterator, returns an (Optional) String - for n in 0..*numDocs { + for n in 0..*num_docs { let timestamp: &i64 = &lines.next().unwrap().unwrap().parse().unwrap(); - let numeric_field = new_index_numeric_field("timestamp".into(), *timestamp); - let mut doc: Vec> = vec![]; - doc.push(Box::new(numeric_field)); + // let numeric_field = new_index_numeric_field("timestamp".into(), *timestamp); + // let mut doc: Vec> = vec![]; + // doc.push(Box::new(numeric_field)); - writer.add_document(doc)?; + // writer.add_document(doc)?; - if (n > 0 && n % 1000000 == 0) { - writer.commit()?; - } + // if n > 0 && n % 1000000 == 0 { + // writer.commit()?; + // } } - let numQueries: &i32 = &lines.next().unwrap().unwrap().parse().unwrap(); + let num_queries: &i32 = &lines.next().unwrap().unwrap().parse().unwrap(); - for n in 0..*numQueries { + for _ in 0..*num_queries { let l = lines.next().unwrap().unwrap(); let mut range = l.split(','); let lower = range.next().unwrap(); - let lowerBound: i64 = lower.parse::().unwrap(); - - // println!("lower: {}", lowerBound); + let lower_bound: i64 = lower.parse::().unwrap(); let upper = range.next().unwrap(); - let upperBound: i64 = upper.parse::().unwrap(); - - // println!("upper: {}", upperBound); + let upper_bound: i64 = upper.parse::().unwrap(); queries.push(LongPoint::new_range_query( "timestamp".into(), - lowerBound, - upperBound, + lower_bound, + upper_bound, )); } - let warmupCount = cmp::min(10000, queries.len()); + let reader = writer.get_reader(true, false)?; + let index_searcher = DefaultIndexSearcher::new(Arc::new(reader), None); + // let warmupCount = cmp::min(1000, queries.len()); // for i in 0..warmupCount { + // let mut collector = TopDocsCollector::new(10); // let query = queries.get(i).unwrap().as_ref().unwrap(); // index_searcher.search(&**query, &mut collector); // } let mut hits: u64 = 0; - let reader = writer.get_reader(true, false)?; - let index_searcher = DefaultIndexSearcher::new(Arc::new(reader), None); let overall_start = Instant::now(); - for iter in queries.iter() { + for (i, iter) in queries.iter().enumerate() { let mut collector = TopDocsCollector::new(10); let query = iter.as_ref().unwrap(); let start_time: Instant = Instant::now(); - index_searcher.search(&**query, &mut collector); + index_searcher.search(&**query, &mut collector)?; let time: Duration = Instant::now().duration_since(start_time); hits += collector.top_docs().total_hits() as u64; sum += time.as_nanos(); } + println!("Total hits: {}", hits); println!( "Searching time: {}", diff --git a/examples/basic_search.rs b/examples/basic_search.rs index 39c4e46..912f164 100644 --- a/examples/basic_search.rs +++ b/examples/basic_search.rs @@ -19,24 +19,24 @@ use rucene::core::highlight::FieldQuery; use rucene::core::util::VariantValue; use rucene::error::Result; -fn indexed_text_field_type() -> FieldType { - let mut field_type = FieldType::default(); - field_type.index_options = IndexOptions::DocsAndFreqsAndPositionsAndOffsets; - field_type.store_term_vectors = true; - field_type.store_term_vector_offsets = true; - field_type.store_term_vector_positions = true; - field_type -} - -fn new_index_text_field(field_name: String, text: String) -> Field { - let token_stream = WhitespaceTokenizer::new(Box::new(StringReader::new(text))); - Field::new( - field_name, - indexed_text_field_type(), - None, - Some(Box::new(token_stream)), - ) -} +// fn indexed_text_field_type() -> FieldType { +// let mut field_type = FieldType::default(); +// field_type.index_options = IndexOptions::DocsAndFreqsAndPositionsAndOffsets; +// field_type.store_term_vectors = true; +// field_type.store_term_vector_offsets = true; +// field_type.store_term_vector_positions = true; +// field_type +// } + +// fn new_index_text_field(field_name: String, text: String) -> Field { +// let token_stream = WhitespaceTokenizer::new(Box::new(StringReader::new(text))); +// Field::new( +// field_name, +// indexed_text_field_type(), +// None, +// Some(Box::new(token_stream)), +// ) +// } fn new_stored_text_field(field_name: String, text: String) -> Field { let mut field_type = FieldType::default(); @@ -91,7 +91,7 @@ fn main() -> Result<()> { let mut doc: Vec> = vec![]; // add indexed text field let text = "The quick brown fox jumps over a lazy dog"; - let text_field = new_index_text_field("title".into(), text.into()); + // let text_field = new_index_text_field("title".into(), text.into()); // doc.push(Box::new(text_field)); // add raw text field, this used for highlight let stored_text_field = new_stored_text_field("title".into(), text.into()); diff --git a/flamegraph.svg b/flamegraph.svg new file mode 100644 index 0000000..37b93af --- /dev/null +++ b/flamegraph.svg @@ -0,0 +1,491 @@ +Flame Graph Reset ZoomSearch [unknown] (6 samples, 0.01%)alloc::sync::Weak<T,A>::inner (8 samples, 0.01%)alloc::rc::is_dangling (7 samples, 0.01%)alloc::sync::Weak<T,A>::upgrade (34 samples, 0.06%)core::sync::atomic::AtomicUsize::fetch_update (26 samples, 0.05%)core::ops::function::FnMut::call_mut (11 samples, 0.02%)alloc::sync::Weak<T,A>::upgrade::checked_increment (11 samples, 0.02%)rucene::core::index::writer::flush_control::DocumentsWriterFlushControl<D,C,MS,MP>::next_pending_flush (8 samples, 0.01%)__pthread_disable_asynccancel (6 samples, 0.01%)std::sys::pal::unix::thread::Thread::sleep (77 samples, 0.13%)__GI___nanosleep (75 samples, 0.13%)<alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once (133 samples, 0.23%)<alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once (133 samples, 0.23%)core::ops::function::FnOnce::call_once{{vtable.shim}} (133 samples, 0.23%)std::thread::Builder::spawn_unchecked_::_{{closure}} (133 samples, 0.23%)std::panic::catch_unwind (133 samples, 0.23%)?? (133 samples, 0.23%)?? (133 samples, 0.23%)?? (133 samples, 0.23%)core::ops::function::FnOnce::call_once{{vtable.shim}} (133 samples, 0.23%)std::sys_common::backtrace::__rust_begin_short_backtrace (133 samples, 0.23%)rucene::core::index::writer::doc_writer::DocumentsWriter<D,C,MS,MP>::start_flush_daemon::_{{closure}} (133 samples, 0.23%)std::thread::sleep (90 samples, 0.16%)std::thread::sleep (12 samples, 0.02%)__GI___clone (189 samples, 0.33%)start_thread (141 samples, 0.25%)std::sys::pal::unix::thread::Thread::new::thread_start (137 samples, 0.24%)<alloc::sync::Arc<T> as rucene::core::codec::points::point_values::PointValues>::doc_count (11 samples, 0.02%)<rucene::core::codec::points::points_reader::Lucene60PointsReader as rucene::core::codec::points::point_values::PointValues>::doc_count (11 samples, 0.02%)rucene::core::codec::points::points_reader::Lucene60PointsReader::bkd_reader (9 samples, 0.02%)std::collections::hash::map::HashMap<K,V,S>::get (7 samples, 0.01%)hashbrown::map::HashMap<K,V,S,A>::get (7 samples, 0.01%)hashbrown::map::HashMap<K,V,S,A>::get_inner (7 samples, 0.01%)<alloc::sync::Arc<T> as rucene::core::codec::points::point_values::PointValues>::max_packed_value (12 samples, 0.02%)<rucene::core::codec::points::points_reader::Lucene60PointsReader as rucene::core::codec::points::point_values::PointValues>::max_packed_value (12 samples, 0.02%)rucene::core::codec::points::points_reader::Lucene60PointsReader::bkd_reader (8 samples, 0.01%)<alloc::sync::Arc<T> as rucene::core::codec::points::point_values::PointValues>::min_packed_value (8 samples, 0.01%)<rucene::core::codec::points::points_reader::Lucene60PointsReader as rucene::core::codec::points::point_values::PointValues>::min_packed_value (8 samples, 0.01%)rucene::core::codec::points::points_reader::Lucene60PointsReader::bkd_reader (7 samples, 0.01%)<rucene::core::index::reader::segment_reader::SegmentReader<D,C> as rucene::core::index::reader::leaf_reader::LeafReader>::point_values (7 samples, 0.01%)<core::option::Option<T> as core::clone::Clone>::clone (6 samples, 0.01%)hashbrown::map::make_hash (7 samples, 0.01%)core::hash::BuildHasher::hash_one (7 samples, 0.01%)rucene::core::codec::field_infos::FieldInfos::field_info_by_name (17 samples, 0.03%)std::collections::hash::map::HashMap<K,V,S>::get (16 samples, 0.03%)hashbrown::map::HashMap<K,V,S,A>::get (16 samples, 0.03%)hashbrown::map::HashMap<K,V,S,A>::get_inner (16 samples, 0.03%)hashbrown::raw::RawTable<T,A>::get (8 samples, 0.01%)hashbrown::raw::RawTable<T,A>::find (8 samples, 0.01%)hashbrown::raw::RawTableInner::find_inner (8 samples, 0.01%)core::ptr::drop_in_place<alloc::boxed::Box<dyn rucene::core::store::io::index_input::IndexInput>> (8 samples, 0.01%)core::ptr::drop_in_place<rucene::core::store::io::mmap_index_input::MmapIndexInput> (6 samples, 0.01%)core::ptr::drop_in_place<rucene::core::store::io::mmap_index_input::ReadOnlySource> (6 samples, 0.01%)core::ptr::drop_in_place<alloc::sync::Arc<memmap::Mmap>> (6 samples, 0.01%)<alloc::sync::Arc<T,A> as core::ops::drop::Drop>::drop (6 samples, 0.01%)?? (20 samples, 0.03%)?? (20 samples, 0.03%)?? (20 samples, 0.03%)?? (20 samples, 0.03%)?? (20 samples, 0.03%)?? (20 samples, 0.03%)core::ptr::drop_in_place<rucene::core::util::bkd::bkd_reader::PackedIndexTree> (20 samples, 0.03%)_int_free (17 samples, 0.03%)core::ptr::drop_in_place<alloc::vec::Vec<alloc::vec::Vec<u8>>> (23 samples, 0.04%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)core::ptr::drop_in_place<rucene::core::util::bkd::bkd_reader::PackedIndexTree> (19 samples, 0.03%)_int_free (18 samples, 0.03%)core::ptr::drop_in_place<alloc::boxed::Box<dyn rucene::core::util::bkd::bkd_reader::IndexTree>> (61 samples, 0.11%)core::ptr::drop_in_place<rucene::core::util::bkd::bkd_reader::PackedIndexTree> (59 samples, 0.10%)core::ptr::drop_in_place<rucene::core::util::bkd::bkd_reader::SimpleIndexTree> (20 samples, 0.03%)core::ptr::drop_in_place<alloc::vec::Vec<alloc::vec::Vec<u8>>> (20 samples, 0.03%)?? (20 samples, 0.03%)core::ptr::drop_in_place<alloc::vec::Vec<i32>> (6 samples, 0.01%)core::ptr::drop_in_place<alloc::raw_vec::RawVec<i32>> (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)core::ptr::drop_in_place<rucene::core::util::bkd::bkd_reader::IntersectState<rucene::core::util::bkd::bkd_reader::StubIntersectVisitor>> (6 samples, 0.01%)core::ptr::drop_in_place<rucene::core::util::bkd::bkd_reader::IntersectState<rucene::core::util::bkd::bkd_reader::StubIntersectVisitor>> (76 samples, 0.13%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::index_input::IndexInput>::clone (11 samples, 0.02%)alloc::boxed::Box<T>::new (8 samples, 0.01%)alloc::alloc::exchange_malloc (8 samples, 0.01%)<alloc::alloc::Global as core::alloc::Allocator>::allocate (8 samples, 0.01%)alloc::alloc::Global::alloc_impl (8 samples, 0.01%)alloc::alloc::alloc (8 samples, 0.01%)__GI___libc_malloc (8 samples, 0.01%)_int_malloc (6 samples, 0.01%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (15 samples, 0.03%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (15 samples, 0.03%)?? (15 samples, 0.03%)?? (15 samples, 0.03%)?? (15 samples, 0.03%)rucene::core::util::bkd::bkd_reader::BKDReader::intersect (15 samples, 0.03%)__calloc (15 samples, 0.03%)_int_malloc (8 samples, 0.01%)rucene::core::util::bkd::bkd_reader::IntersectState<IV>::new (23 samples, 0.04%)alloc::vec::from_elem (23 samples, 0.04%)<u8 as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (8 samples, 0.01%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::intersect (8 samples, 0.01%)__calloc (8 samples, 0.01%)__memset_avx2_unaligned_erms (10 samples, 0.02%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (29 samples, 0.05%)?? (29 samples, 0.05%)?? (29 samples, 0.05%)?? (29 samples, 0.05%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::new (29 samples, 0.05%)__calloc (29 samples, 0.05%)_int_malloc (12 samples, 0.02%)__GI___libc_malloc (33 samples, 0.06%)_int_malloc (14 samples, 0.02%)alloc::vec::Vec<T,A>::with_capacity_in (34 samples, 0.06%)alloc::raw_vec::RawVec<T,A>::with_capacity_in (34 samples, 0.06%)?? (34 samples, 0.06%)?? (34 samples, 0.06%)?? (34 samples, 0.06%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (34 samples, 0.06%)<alloc::vec::Vec<T,A> as core::clone::Clone>::clone (35 samples, 0.06%)alloc::slice::<impl [T]>::to_vec_in (35 samples, 0.06%)alloc::slice::hack::to_vec (35 samples, 0.06%)<T as alloc::slice::hack::ConvertVec>::to_vec (35 samples, 0.06%)alloc::vec::Vec<T,A>::extend_with (36 samples, 0.06%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (70 samples, 0.12%)__calloc (8 samples, 0.01%)alloc::vec::from_elem (79 samples, 0.14%)<u8 as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (9 samples, 0.02%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::new (9 samples, 0.02%)alloc::vec::Vec<T,A>::with_capacity_in (32 samples, 0.06%)alloc::raw_vec::RawVec<T,A>::with_capacity_in (32 samples, 0.06%)?? (32 samples, 0.06%)?? (32 samples, 0.06%)?? (32 samples, 0.06%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (32 samples, 0.06%)__GI___libc_malloc (32 samples, 0.06%)_int_malloc (24 samples, 0.04%)<alloc::vec::Vec<T,A> as core::clone::Clone>::clone (35 samples, 0.06%)alloc::slice::<impl [T]>::to_vec_in (35 samples, 0.06%)alloc::slice::hack::to_vec (35 samples, 0.06%)<T as alloc::slice::hack::ConvertVec>::to_vec (35 samples, 0.06%)alloc::vec::Vec<T,A>::extend_with (36 samples, 0.06%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (38 samples, 0.07%)rucene::core::util::bkd::bkd_reader::BKDReader::create_intersect_state (166 samples, 0.29%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::new (128 samples, 0.22%)rucene::core::util::bkd::bkd_reader::SimpleIndexTree::new (46 samples, 0.08%)alloc::vec::from_elem (46 samples, 0.08%)<u8 as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (8 samples, 0.01%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::new (8 samples, 0.01%)__calloc (8 samples, 0.01%)_int_malloc (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (17 samples, 0.03%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (13 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::SimpleIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (6 samples, 0.01%)__GI___libc_malloc (6 samples, 0.01%)<alloc::vec::Vec<T> as core::convert::From<&[T]>>::from (6 samples, 0.01%)alloc::slice::<impl [T]>::to_vec (6 samples, 0.01%)alloc::slice::<impl [T]>::to_vec_in (6 samples, 0.01%)alloc::slice::hack::to_vec (6 samples, 0.01%)<T as alloc::slice::hack::ConvertVec>::to_vec (6 samples, 0.01%)alloc::vec::Vec<T,A>::with_capacity_in (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (6 samples, 0.01%)__GI___libc_malloc (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (10 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (13 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (13 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (12 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (11 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::SimpleIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (7 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)<alloc::vec::Vec<T> as core::convert::From<&[T]>>::from (9 samples, 0.02%)alloc::slice::<impl [T]>::to_vec (9 samples, 0.02%)alloc::slice::<impl [T]>::to_vec_in (9 samples, 0.02%)alloc::slice::hack::to_vec (9 samples, 0.02%)<T as alloc::slice::hack::ConvertVec>::to_vec (9 samples, 0.02%)alloc::vec::Vec<T,A>::with_capacity_in (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (9 samples, 0.02%)__GI___libc_malloc (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (21 samples, 0.04%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (16 samples, 0.03%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (13 samples, 0.02%)core::ptr::drop_in_place<alloc::vec::Vec<u8>> (7 samples, 0.01%)core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8>> (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (10 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (18 samples, 0.03%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (13 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_vint (7 samples, 0.01%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::data_input::DataInput>::read_byte (7 samples, 0.01%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (27 samples, 0.05%)<i64 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (12 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (29 samples, 0.05%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (22 samples, 0.04%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (14 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (187 samples, 0.33%)?? (54 samples, 0.09%)?? (32 samples, 0.06%)?? (18 samples, 0.03%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (18 samples, 0.03%)?? (58 samples, 0.10%)rucene::core::store::io::data_input::DataInput::read_long (58 samples, 0.10%)__memmove_avx_unaligned_erms (49 samples, 0.09%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (69 samples, 0.12%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (9 samples, 0.02%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (9 samples, 0.02%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (9 samples, 0.02%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (9 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_long (8 samples, 0.01%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (419 samples, 0.73%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (419 samples, 0.73%)rucene::core::store::io::data_input::DataInput::read_long (145 samples, 0.25%)std::io::Read::read_exact (79 samples, 0.14%)std::io::default_read_exact (79 samples, 0.14%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (430 samples, 0.75%)rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (429 samples, 0.75%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (7 samples, 0.01%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (13 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (71 samples, 0.12%)?? (19 samples, 0.03%)?? (14 samples, 0.02%)?? (9 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (9 samples, 0.02%)?? (22 samples, 0.04%)rucene::core::store::io::data_input::DataInput::read_long (22 samples, 0.04%)__memmove_avx_unaligned_erms (21 samples, 0.04%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (31 samples, 0.05%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (150 samples, 0.26%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (150 samples, 0.26%)rucene::core::store::io::data_input::DataInput::read_long (55 samples, 0.10%)std::io::Read::read_exact (34 samples, 0.06%)std::io::default_read_exact (34 samples, 0.06%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (599 samples, 1.05%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (599 samples, 1.05%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (598 samples, 1.04%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (595 samples, 1.04%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (594 samples, 1.04%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (590 samples, 1.03%)rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (155 samples, 0.27%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::compare (10 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (18 samples, 0.03%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (10 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (11 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::SimpleIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (7 samples, 0.01%)__GI___libc_malloc (7 samples, 0.01%)core::ptr::drop_in_place<alloc::vec::Vec<u8>> (6 samples, 0.01%)core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8>> (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (13 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (10 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (14 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (12 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (12 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (9 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::pop (15 samples, 0.03%)<rucene::core::util::bkd::bkd_reader::SimpleIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::pop (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (10 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_vint (28 samples, 0.05%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::data_input::DataInput>::read_byte (28 samples, 0.05%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (190 samples, 0.33%)<i64 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (79 samples, 0.14%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (235 samples, 0.41%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (117 samples, 0.20%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (88 samples, 0.15%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (1,541 samples, 2.69%)<r..?? (383 samples, 0.67%)?? (266 samples, 0.46%)?? (178 samples, 0.31%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (178 samples, 0.31%)core::num::<impl u64>::swap_bytes (88 samples, 0.15%)core::num::<impl i64>::to_be (94 samples, 0.16%)core::num::<impl i64>::swap_bytes (94 samples, 0.16%)rucene::core::store::io::data_input::DataInput::read_long (6 samples, 0.01%)?? (425 samples, 0.74%)rucene::core::store::io::data_input::DataInput::read_long (425 samples, 0.74%)__memmove_avx_unaligned_erms (363 samples, 0.63%)core::cmp::Ord::min (18 samples, 0.03%)rucene::core::store::io::data_input::DataInput::read_long (18 samples, 0.03%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (586 samples, 1.02%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (17 samples, 0.03%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (17 samples, 0.03%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked (17 samples, 0.03%)core::ptr::const_ptr::<impl *const T>::add (17 samples, 0.03%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (81 samples, 0.14%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (81 samples, 0.14%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (81 samples, 0.14%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (81 samples, 0.14%)rucene::core::store::io::data_input::DataInput::read_long (77 samples, 0.13%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (3,642 samples, 6.36%)rucene::..rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (3,640 samples, 6.36%)rucene::..rucene::core::store::io::data_input::DataInput::read_long (1,457 samples, 2.55%)ru..std::io::Read::read_exact (681 samples, 1.19%)std::io::default_read_exact (681 samples, 1.19%)rucene::core::store::io::data_input::DataInput::read_long (14 samples, 0.02%)__memset_avx2_erms (6 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (7 samples, 0.01%)__calloc (7 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,692 samples, 6.45%)rucene::..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (3,691 samples, 6.45%)rucene::..rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (17 samples, 0.03%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::upgrade2bit_set (17 samples, 0.03%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (13 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (13 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (8 samples, 0.01%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (8 samples, 0.01%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (106 samples, 0.19%)?? (26 samples, 0.05%)?? (18 samples, 0.03%)?? (10 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (10 samples, 0.02%)core::num::<impl u64>::swap_bytes (7 samples, 0.01%)core::num::<impl i64>::to_be (8 samples, 0.01%)core::num::<impl i64>::swap_bytes (8 samples, 0.01%)?? (25 samples, 0.04%)rucene::core::store::io::data_input::DataInput::read_long (25 samples, 0.04%)__memmove_avx_unaligned_erms (23 samples, 0.04%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (36 samples, 0.06%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (219 samples, 0.38%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (219 samples, 0.38%)rucene::core::store::io::data_input::DataInput::read_long (74 samples, 0.13%)std::io::Read::read_exact (37 samples, 0.06%)std::io::default_read_exact (37 samples, 0.06%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (4,017 samples, 7.02%)rucene::c..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (4,012 samples, 7.01%)rucene::c..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (4,003 samples, 6.99%)rucene::c..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,976 samples, 6.95%)rucene::c..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,953 samples, 6.91%)rucene::c..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (221 samples, 0.39%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::compare (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (14 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (23 samples, 0.04%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (16 samples, 0.03%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_dim_value (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (8 samples, 0.01%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (14 samples, 0.02%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (10 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (13 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::pop (10 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::SimpleIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::pop (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (9 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_vint (24 samples, 0.04%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::data_input::DataInput>::read_byte (24 samples, 0.04%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (189 samples, 0.33%)<i64 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (62 samples, 0.11%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (214 samples, 0.37%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (118 samples, 0.21%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (75 samples, 0.13%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (1,394 samples, 2.44%)<r..?? (361 samples, 0.63%)?? (243 samples, 0.42%)?? (168 samples, 0.29%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (168 samples, 0.29%)core::num::<impl u64>::swap_bytes (74 samples, 0.13%)core::num::<impl i64>::to_be (88 samples, 0.15%)core::num::<impl i64>::swap_bytes (88 samples, 0.15%)rucene::core::store::io::data_input::DataInput::read_long (14 samples, 0.02%)?? (369 samples, 0.64%)rucene::core::store::io::data_input::DataInput::read_long (369 samples, 0.64%)__memmove_avx_unaligned_erms (315 samples, 0.55%)core::cmp::Ord::min (14 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_long (14 samples, 0.02%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (512 samples, 0.89%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (19 samples, 0.03%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (19 samples, 0.03%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked (19 samples, 0.03%)core::ptr::const_ptr::<impl *const T>::add (19 samples, 0.03%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (77 samples, 0.13%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (77 samples, 0.13%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (77 samples, 0.13%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (77 samples, 0.13%)rucene::core::store::io::data_input::DataInput::read_long (75 samples, 0.13%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (3,202 samples, 5.59%)rucene:..rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (3,201 samples, 5.59%)rucene:..rucene::core::store::io::data_input::DataInput::read_long (1,215 samples, 2.12%)r..std::io::Read::read_exact (606 samples, 1.06%)std::io::default_read_exact (606 samples, 1.06%)rucene::core::store::io::data_input::DataInput::read_long (17 samples, 0.03%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (18 samples, 0.03%)<rucene::core::util::bit_set::FixedBitSet as rucene::core::util::bit_set::BitSet>::set (9 samples, 0.02%)__memset_avx2_erms (12 samples, 0.02%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,287 samples, 5.74%)rucene:..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (3,283 samples, 5.74%)rucene:..rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (49 samples, 0.09%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::upgrade2bit_set (46 samples, 0.08%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)?? (19 samples, 0.03%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (19 samples, 0.03%)__calloc (19 samples, 0.03%)_int_malloc (7 samples, 0.01%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (6 samples, 0.01%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (35 samples, 0.06%)?? (8 samples, 0.01%)?? (6 samples, 0.01%)?? (11 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_long (11 samples, 0.02%)__memmove_avx_unaligned_erms (8 samples, 0.01%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (16 samples, 0.03%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (91 samples, 0.16%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (91 samples, 0.16%)rucene::core::store::io::data_input::DataInput::read_long (41 samples, 0.07%)std::io::Read::read_exact (18 samples, 0.03%)std::io::default_read_exact (18 samples, 0.03%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,471 samples, 6.06%)rucene::..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,460 samples, 6.04%)rucene::..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,444 samples, 6.02%)rucene::..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (3,417 samples, 5.97%)rucene::..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (95 samples, 0.17%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::compare (13 samples, 0.02%)core::cmp::PartialOrd::gt (6 samples, 0.01%)core::slice::cmp::<impl core::cmp::PartialOrd for [T]>::partial_cmp (6 samples, 0.01%)<A as core::slice::cmp::SlicePartialOrd>::partial_compare (6 samples, 0.01%)<u8 as core::slice::cmp::SliceOrd>::compare (6 samples, 0.01%)__GI___libc_malloc (6 samples, 0.01%)alloc::vec::Vec<T,A>::with_capacity_in (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (7 samples, 0.01%)<alloc::vec::Vec<T> as core::convert::From<&[T]>>::from (8 samples, 0.01%)alloc::slice::<impl [T]>::to_vec (8 samples, 0.01%)alloc::slice::<impl [T]>::to_vec_in (8 samples, 0.01%)alloc::slice::hack::to_vec (8 samples, 0.01%)<T as alloc::slice::hack::ConvertVec>::to_vec (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (14 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (17 samples, 0.03%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (12 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::SimpleIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (7 samples, 0.01%)__GI___libc_malloc (7 samples, 0.01%)_int_malloc (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (16 samples, 0.03%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (12 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_vint (14 samples, 0.02%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::data_input::DataInput>::read_byte (13 samples, 0.02%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (124 samples, 0.22%)<i64 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (51 samples, 0.09%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (195 samples, 0.34%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (73 samples, 0.13%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (40 samples, 0.07%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (895 samples, 1.56%)?? (195 samples, 0.34%)?? (122 samples, 0.21%)?? (82 samples, 0.14%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (82 samples, 0.14%)core::num::<impl u64>::swap_bytes (44 samples, 0.08%)core::num::<impl i64>::to_be (54 samples, 0.09%)core::num::<impl i64>::swap_bytes (54 samples, 0.09%)rucene::core::store::io::data_input::DataInput::read_long (10 samples, 0.02%)?? (246 samples, 0.43%)rucene::core::store::io::data_input::DataInput::read_long (246 samples, 0.43%)__memmove_avx_unaligned_erms (207 samples, 0.36%)core::cmp::Ord::min (12 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_long (12 samples, 0.02%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (337 samples, 0.59%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (6 samples, 0.01%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (6 samples, 0.01%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked (6 samples, 0.01%)core::ptr::const_ptr::<impl *const T>::add (6 samples, 0.01%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (29 samples, 0.05%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (29 samples, 0.05%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (29 samples, 0.05%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (29 samples, 0.05%)rucene::core::store::io::data_input::DataInput::read_long (25 samples, 0.04%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (2,015 samples, 3.52%)ruc..rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (2,013 samples, 3.52%)ruc..rucene::core::store::io::data_input::DataInput::read_long (754 samples, 1.32%)std::io::Read::read_exact (369 samples, 0.64%)std::io::default_read_exact (369 samples, 0.64%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::ensure_buffer_capacity (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::add_buffer (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::Buffer::with_length (7 samples, 0.01%)alloc::vec::from_elem (7 samples, 0.01%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (7 samples, 0.01%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (7 samples, 0.01%)__calloc (7 samples, 0.01%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (38 samples, 0.07%)[unknown] (13 samples, 0.02%)<rucene::core::util::bit_set::FixedBitSet as rucene::core::util::bit_set::BitSet>::set (44 samples, 0.08%)core::ptr::mut_ptr::<impl *mut T>::add (19 samples, 0.03%)__memset_avx2_erms (17 samples, 0.03%)[unknown] (7 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (2,166 samples, 3.78%)ruce..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (2,160 samples, 3.77%)ruce..rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (123 samples, 0.21%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::upgrade2bit_set (116 samples, 0.20%)?? (33 samples, 0.06%)?? (33 samples, 0.06%)?? (33 samples, 0.06%)?? (33 samples, 0.06%)?? (33 samples, 0.06%)?? (33 samples, 0.06%)?? (33 samples, 0.06%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (33 samples, 0.06%)__calloc (33 samples, 0.06%)_int_malloc (16 samples, 0.03%)sysmalloc (16 samples, 0.03%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (6 samples, 0.01%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (14 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (31 samples, 0.05%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (61 samples, 0.11%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (60 samples, 0.10%)rucene::core::store::io::data_input::DataInput::read_long (16 samples, 0.03%)std::io::Read::read_exact (6 samples, 0.01%)std::io::default_read_exact (6 samples, 0.01%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (6 samples, 0.01%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (7 samples, 0.01%)<rucene::core::util::bit_set::FixedBitSet as rucene::core::util::bit_set::BitSet>::set (7 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (2,315 samples, 4.04%)ruce..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (2,304 samples, 4.03%)ruce..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (2,278 samples, 3.98%)ruce..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (84 samples, 0.15%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (23 samples, 0.04%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::upgrade2bit_set (21 samples, 0.04%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (7 samples, 0.01%)__calloc (7 samples, 0.01%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::compare (15 samples, 0.03%)__GI___libc_malloc (10 samples, 0.02%)_int_malloc (6 samples, 0.01%)<alloc::vec::Vec<T> as core::convert::From<&[T]>>::from (12 samples, 0.02%)alloc::slice::<impl [T]>::to_vec (12 samples, 0.02%)alloc::slice::<impl [T]>::to_vec_in (12 samples, 0.02%)alloc::slice::hack::to_vec (12 samples, 0.02%)<T as alloc::slice::hack::ConvertVec>::to_vec (12 samples, 0.02%)alloc::vec::Vec<T,A>::with_capacity_in (12 samples, 0.02%)?? (12 samples, 0.02%)?? (11 samples, 0.02%)?? (11 samples, 0.02%)?? (11 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (11 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (20 samples, 0.03%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (15 samples, 0.03%)rucene::core::util::bkd::bkd_reader::PackedIndexTree::read_node_data (9 samples, 0.02%)__GI___libc_malloc (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (8 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::SimpleIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_packed_value (7 samples, 0.01%)core::ptr::drop_in_place<alloc::vec::Vec<u8>> (6 samples, 0.01%)core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8>> (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (6 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (6 samples, 0.01%)rucene::core::store::io::data_input::DataInput::read_vint (12 samples, 0.02%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::data_input::DataInput>::read_byte (11 samples, 0.02%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (63 samples, 0.11%)<i64 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (23 samples, 0.04%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (162 samples, 0.28%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (22 samples, 0.04%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (14 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (488 samples, 0.85%)?? (74 samples, 0.13%)?? (52 samples, 0.09%)?? (38 samples, 0.07%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (38 samples, 0.07%)core::num::<impl u64>::swap_bytes (28 samples, 0.05%)core::num::<impl i64>::to_be (33 samples, 0.06%)core::num::<impl i64>::swap_bytes (33 samples, 0.06%)?? (125 samples, 0.22%)rucene::core::store::io::data_input::DataInput::read_long (125 samples, 0.22%)__memmove_avx_unaligned_erms (108 samples, 0.19%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (176 samples, 0.31%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (6 samples, 0.01%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (6 samples, 0.01%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked (6 samples, 0.01%)core::ptr::const_ptr::<impl *const T>::add (6 samples, 0.01%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (31 samples, 0.05%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (31 samples, 0.05%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (31 samples, 0.05%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (31 samples, 0.05%)rucene::core::store::io::data_input::DataInput::read_long (28 samples, 0.05%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (1,105 samples, 1.93%)r..rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (1,105 samples, 1.93%)r..rucene::core::store::io::data_input::DataInput::read_long (426 samples, 0.74%)std::io::Read::read_exact (210 samples, 0.37%)std::io::default_read_exact (210 samples, 0.37%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::add_buffer (10 samples, 0.02%)rucene::core::util::doc_id_set_builder::Buffer::with_length (9 samples, 0.02%)alloc::vec::from_elem (9 samples, 0.02%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (9 samples, 0.02%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (9 samples, 0.02%)__calloc (9 samples, 0.02%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::ensure_buffer_capacity (11 samples, 0.02%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (74 samples, 0.13%)[unknown] (12 samples, 0.02%)<rucene::core::util::bit_set::FixedBitSet as rucene::core::util::bit_set::BitSet>::set (66 samples, 0.12%)core::ptr::mut_ptr::<impl *mut T>::add (30 samples, 0.05%)__memset_avx2_erms (34 samples, 0.06%)[unknown] (10 samples, 0.02%)?? (60 samples, 0.10%)?? (60 samples, 0.10%)?? (60 samples, 0.10%)?? (60 samples, 0.10%)?? (60 samples, 0.10%)?? (60 samples, 0.10%)?? (60 samples, 0.10%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (60 samples, 0.10%)__calloc (60 samples, 0.10%)_int_malloc (24 samples, 0.04%)sysmalloc (23 samples, 0.04%)__GI___default_morecore (10 samples, 0.02%)__GI___sbrk (9 samples, 0.02%)__brk (9 samples, 0.02%)[unknown] (9 samples, 0.02%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (1,343 samples, 2.35%)r..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (1,342 samples, 2.34%)r..rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (220 samples, 0.38%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::upgrade2bit_set (207 samples, 0.36%)core::ptr::drop_in_place<alloc::vec::Vec<rucene::core::util::doc_id_set_builder::Buffer>> (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (7 samples, 0.01%)_int_free (6 samples, 0.01%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (13 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (18 samples, 0.03%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (35 samples, 0.06%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (35 samples, 0.06%)rucene::core::store::io::data_input::DataInput::read_long (13 samples, 0.02%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (1,399 samples, 2.44%)ru..rucene::core::util::bkd::bkd_reader::BKDReader::add_all (1,387 samples, 2.42%)ru..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (36 samples, 0.06%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::compare (11 samples, 0.02%)__GI___libc_malloc (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (11 samples, 0.02%)<alloc::vec::Vec<T> as core::convert::From<&[T]>>::from (9 samples, 0.02%)alloc::slice::<impl [T]>::to_vec (9 samples, 0.02%)alloc::slice::<impl [T]>::to_vec_in (9 samples, 0.02%)alloc::slice::hack::to_vec (9 samples, 0.02%)<T as alloc::slice::hack::ConvertVec>::to_vec (9 samples, 0.02%)alloc::vec::Vec<T,A>::with_capacity_in (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_left (9 samples, 0.02%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::push_right (7 samples, 0.01%)<rucene::core::util::bkd::bkd_reader::PackedIndexTree as rucene::core::util::bkd::bkd_reader::IndexTree>::split_dim_value (6 samples, 0.01%)?? (6 samples, 0.01%)rucene::core::store::io::data_input::DataInput::read_vint (6 samples, 0.01%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::data_input::DataInput>::read_byte (6 samples, 0.01%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (43 samples, 0.08%)<i64 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (13 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (175 samples, 0.31%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (10 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (20 samples, 0.03%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (333 samples, 0.58%)?? (49 samples, 0.09%)?? (39 samples, 0.07%)?? (19 samples, 0.03%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (19 samples, 0.03%)core::num::<impl u64>::swap_bytes (16 samples, 0.03%)core::num::<impl i64>::to_be (17 samples, 0.03%)core::num::<impl i64>::swap_bytes (17 samples, 0.03%)?? (103 samples, 0.18%)rucene::core::store::io::data_input::DataInput::read_long (103 samples, 0.18%)__memmove_avx_unaligned_erms (89 samples, 0.16%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (128 samples, 0.22%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (17 samples, 0.03%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (17 samples, 0.03%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (17 samples, 0.03%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (17 samples, 0.03%)rucene::core::store::io::data_input::DataInput::read_long (15 samples, 0.03%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (750 samples, 1.31%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (749 samples, 1.31%)rucene::core::store::io::data_input::DataInput::read_long (290 samples, 0.51%)std::io::Read::read_exact (146 samples, 0.26%)std::io::default_read_exact (146 samples, 0.26%)__memset_avx2_erms (11 samples, 0.02%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::ensure_buffer_capacity (17 samples, 0.03%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::add_buffer (17 samples, 0.03%)rucene::core::util::doc_id_set_builder::Buffer::with_length (16 samples, 0.03%)alloc::vec::from_elem (16 samples, 0.03%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (16 samples, 0.03%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (16 samples, 0.03%)?? (16 samples, 0.03%)?? (16 samples, 0.03%)?? (16 samples, 0.03%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (16 samples, 0.03%)__calloc (16 samples, 0.03%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (780 samples, 1.36%)rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (780 samples, 1.36%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (22 samples, 0.04%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (12 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (21 samples, 0.04%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (37 samples, 0.06%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (37 samples, 0.06%)rucene::core::store::io::data_input::DataInput::read_long (6 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (828 samples, 1.45%)rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (38 samples, 0.07%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::compare (6 samples, 0.01%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (20 samples, 0.03%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (159 samples, 0.28%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (15 samples, 0.03%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (280 samples, 0.49%)?? (29 samples, 0.05%)?? (25 samples, 0.04%)?? (10 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit (10 samples, 0.02%)core::num::<impl u64>::swap_bytes (9 samples, 0.02%)core::num::<impl i64>::to_be (14 samples, 0.02%)core::num::<impl i64>::swap_bytes (14 samples, 0.02%)?? (62 samples, 0.11%)rucene::core::store::io::data_input::DataInput::read_long (62 samples, 0.11%)__memmove_avx_unaligned_erms (57 samples, 0.10%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (79 samples, 0.14%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (11 samples, 0.02%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (11 samples, 0.02%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (11 samples, 0.02%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (11 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_long (10 samples, 0.02%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints_with_visitor (537 samples, 0.94%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24_with_visitor (537 samples, 0.94%)rucene::core::store::io::data_input::DataInput::read_long (187 samples, 0.33%)std::io::Read::read_exact (94 samples, 0.16%)std::io::default_read_exact (94 samples, 0.16%)__memset_avx2_erms (6 samples, 0.01%)__calloc (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::ensure_buffer_capacity (8 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::add_buffer (8 samples, 0.01%)rucene::core::util::doc_id_set_builder::Buffer::with_length (8 samples, 0.01%)alloc::vec::from_elem (8 samples, 0.01%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (8 samples, 0.01%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (8 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::add_all (553 samples, 0.97%)rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_ids (552 samples, 0.96%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (11 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_vint (14 samples, 0.02%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as rucene::core::store::io::data_input::DataInput>::read_byte (13 samples, 0.02%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints (8 samples, 0.01%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (46 samples, 0.08%)<i64 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (16 samples, 0.03%)core::num::<impl u64>::swap_bytes (35 samples, 0.06%)core::num::<impl i64>::to_be (51 samples, 0.09%)core::num::<impl i64>::swap_bytes (51 samples, 0.09%)rucene::core::store::io::data_input::DataInput::read_long (16 samples, 0.03%)?? (178 samples, 0.31%)rucene::core::store::io::data_input::DataInput::read_long (178 samples, 0.31%)__memmove_avx_unaligned_erms (164 samples, 0.29%)core::cmp::Ord::min (15 samples, 0.03%)rucene::core::store::io::data_input::DataInput::read_long (15 samples, 0.03%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (221 samples, 0.39%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (11 samples, 0.02%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (11 samples, 0.02%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked (8 samples, 0.01%)core::ptr::const_ptr::<impl *const T>::add (8 samples, 0.01%)core::slice::index::<impl core::ops::index::IndexMut<I> for [T]>::index_mut (20 samples, 0.03%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::index_mut (20 samples, 0.03%)<core::ops::range::RangeFrom<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (20 samples, 0.03%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked_mut (20 samples, 0.03%)rucene::core::store::io::data_input::DataInput::read_long (18 samples, 0.03%)rucene::core::store::io::data_input::DataInput::read_long (497 samples, 0.87%)std::io::Read::read_exact (249 samples, 0.44%)std::io::default_read_exact (249 samples, 0.44%)rucene::core::store::io::data_input::DataInput::read_long (8 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::read_doc_ids (717 samples, 1.25%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints (700 samples, 1.22%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24 (686 samples, 1.20%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints (9 samples, 0.02%)rucene::core::util::bkd::bkd_reader::BKDReader::read_common_prefixes (9 samples, 0.02%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (149 samples, 0.26%)<core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::next (40 samples, 0.07%)<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next (40 samples, 0.07%)<core::ptr::non_null::NonNull<T> as core::cmp::PartialEq>::eq (40 samples, 0.07%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (185 samples, 0.32%)<alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index (46 samples, 0.08%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (46 samples, 0.08%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (46 samples, 0.08%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit_by_packed_value (342 samples, 0.60%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit_by_packed_value (30 samples, 0.05%)?? (47 samples, 0.08%)?? (47 samples, 0.08%)?? (17 samples, 0.03%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit_by_packed_value (17 samples, 0.03%)core::cmp::PartialOrd::gt (376 samples, 0.66%)core::slice::cmp::<impl core::cmp::PartialOrd for [T]>::partial_cmp (332 samples, 0.58%)<A as core::slice::cmp::SlicePartialOrd>::partial_compare (332 samples, 0.58%)<u8 as core::slice::cmp::SliceOrd>::compare (332 samples, 0.58%)__memcmp_avx2_movbe (288 samples, 0.50%)core::cmp::PartialOrd::lt (1,180 samples, 2.06%)c..core::slice::cmp::<impl core::cmp::PartialOrd for [T]>::partial_cmp (1,180 samples, 2.06%)c..<A as core::slice::cmp::SlicePartialOrd>::partial_compare (1,180 samples, 2.06%)<..<u8 as core::slice::cmp::SliceOrd>::compare (1,180 samples, 2.06%)<..__memcmp_avx2_movbe (1,116 samples, 1.95%)_..<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit_by_packed_value (2,882 samples, 5.03%)<rucen..core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (63 samples, 0.11%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (63 samples, 0.11%)<usize as core::iter::range::Step>::forward_unchecked (56 samples, 0.10%)core::num::<impl usize>::unchecked_add (56 samples, 0.10%)core::iter::range::<impl core::iter::traits::iterator::Iterator for core::ops::range::Range<A>>::next (112 samples, 0.20%)<core::ops::range::Range<T> as core::iter::range::RangeIteratorImpl>::spec_next (112 samples, 0.20%)core::cmp::impls::<impl core::cmp::PartialOrd for usize>::lt (44 samples, 0.08%)?? (321 samples, 0.56%)rucene::core::store::io::data_input::DataInput::read_bytes (321 samples, 0.56%)__memmove_avx_unaligned_erms (269 samples, 0.47%)core::cmp::Ord::min (53 samples, 0.09%)rucene::core::store::io::data_input::DataInput::read_bytes (53 samples, 0.09%)rucene::core::util::bkd::bkd_reader::BKDReader::visit_compressed_doc_values (4,698 samples, 8.21%)rucene::cor..rucene::core::store::io::data_input::DataInput::read_bytes (968 samples, 1.69%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (505 samples, 0.88%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (50 samples, 0.09%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::index (50 samples, 0.09%)<core::ops::range::Range<usize> as core::slice::index::SliceIndex<[T]>>::get_unchecked (13 samples, 0.02%)core::ptr::const_ptr::<impl *const T>::add (13 samples, 0.02%)__memset_avx2_erms (10 samples, 0.02%)__memset_avx2_unaligned_erms (6 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::ensure_buffer_capacity (29 samples, 0.05%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::add_buffer (28 samples, 0.05%)rucene::core::util::doc_id_set_builder::Buffer::with_length (25 samples, 0.04%)alloc::vec::from_elem (25 samples, 0.04%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (25 samples, 0.04%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (25 samples, 0.04%)?? (25 samples, 0.04%)?? (25 samples, 0.04%)?? (25 samples, 0.04%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (25 samples, 0.04%)__calloc (25 samples, 0.04%)_int_malloc (6 samples, 0.01%)<rucene::core::util::bit_set::FixedBitSet as rucene::core::util::bit_set::BitSet>::set (7 samples, 0.01%)core::ptr::mut_ptr::<impl *mut T>::add (6 samples, 0.01%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)?? (9 samples, 0.02%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (9 samples, 0.02%)__calloc (9 samples, 0.02%)_int_malloc (6 samples, 0.01%)sysmalloc (6 samples, 0.01%)rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (6,042 samples, 10.56%)rucene::core::u..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_values (4,762 samples, 8.32%)rucene::core..rucene::core::util::doc_id_set_builder::DocIdSetBuilder::grow (53 samples, 0.09%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::upgrade2bit_set (23 samples, 0.04%)?? (11 samples, 0.02%)rucene::core::store::io::data_input::DataInput::read_long (11 samples, 0.02%)__memmove_avx_unaligned_erms (9 samples, 0.02%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (16 samples, 0.03%)rucene::core::util::bkd::bkd_reader::BKDReader::read_doc_ids (45 samples, 0.08%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints (44 samples, 0.08%)rucene::core::util::bkd::doc_ids_writer::DocIdsWriter::read_ints24 (44 samples, 0.08%)rucene::core::store::io::data_input::DataInput::read_long (32 samples, 0.06%)std::io::Read::read_exact (19 samples, 0.03%)std::io::default_read_exact (19 samples, 0.03%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (14 samples, 0.02%)<core::iter::adapters::enumerate::Enumerate<I> as core::iter::traits::iterator::Iterator>::next (6 samples, 0.01%)<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next (6 samples, 0.01%)<core::ptr::non_null::NonNull<T> as core::cmp::PartialEq>::eq (6 samples, 0.01%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (9 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit_by_packed_value (20 samples, 0.03%)core::cmp::PartialOrd::gt (21 samples, 0.04%)core::slice::cmp::<impl core::cmp::PartialOrd for [T]>::partial_cmp (17 samples, 0.03%)<A as core::slice::cmp::SlicePartialOrd>::partial_compare (17 samples, 0.03%)<u8 as core::slice::cmp::SliceOrd>::compare (17 samples, 0.03%)__memcmp_avx2_movbe (14 samples, 0.02%)core::cmp::PartialOrd::lt (59 samples, 0.10%)core::slice::cmp::<impl core::cmp::PartialOrd for [T]>::partial_cmp (59 samples, 0.10%)<A as core::slice::cmp::SlicePartialOrd>::partial_compare (59 samples, 0.10%)<u8 as core::slice::cmp::SliceOrd>::compare (59 samples, 0.10%)__memcmp_avx2_movbe (56 samples, 0.10%)<rucene::core::search::query::point_range_query::PointRangeIntersectVisitor as rucene::core::codec::points::point_values::IntersectVisitor>::visit_by_packed_value (158 samples, 0.28%)?? (19 samples, 0.03%)rucene::core::store::io::data_input::DataInput::read_bytes (19 samples, 0.03%)__memmove_avx_unaligned_erms (17 samples, 0.03%)rucene::core::util::bkd::bkd_reader::BKDReader::visit_compressed_doc_values (272 samples, 0.48%)rucene::core::store::io::data_input::DataInput::read_bytes (61 samples, 0.11%)<rucene::core::store::io::mmap_index_input::MmapIndexInput as std::io::Read>::read (26 samples, 0.05%)core::option::Option<T>::map (19,827 samples, 34.64%)core::option::Option<T>::map<rucene::core::codec::points::points_reader::Lucene60PointsReader as rucene::core::codec::points::point_values::PointValues>::intersect::_{{closure}} (19,826 samples, 34.64%)<rucene::core::codec::points::points_reader::Lucene60Poi..rucene::core::util::bkd::bkd_reader::BKDReader::intersect (19,826 samples, 34.64%)rucene::core::util::bkd::bkd_reader::BKDReader::intersectrucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (19,578 samples, 34.20%)rucene::core::util::bkd::bkd_reader::BKDReader::interse..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (19,524 samples, 34.11%)rucene::core::util::bkd::bkd_reader::BKDReader::interse..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (19,483 samples, 34.04%)rucene::core::util::bkd::bkd_reader::BKDReader::interse..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (19,428 samples, 33.94%)rucene::core::util::bkd::bkd_reader::BKDReader::interse..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (19,365 samples, 33.83%)rucene::core::util::bkd::bkd_reader::BKDReader::interse..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (18,711 samples, 32.69%)rucene::core::util::bkd::bkd_reader::BKDReader::inter..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (14,631 samples, 25.56%)rucene::core::util::bkd::bkd_reader::BKDR..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (11,096 samples, 19.38%)rucene::core::util::bkd::bkd_r..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (8,715 samples, 15.23%)rucene::core::util::bkd..rucene::core::util::bkd::bkd_reader::BKDReader::intersect_with_state (7,240 samples, 12.65%)rucene::core::util:..rucene::core::util::bkd::bkd_reader::BKDReader::visit_doc_values (274 samples, 0.48%)<alloc::sync::Arc<T> as rucene::core::codec::points::point_values::PointValues>::intersect (19,830 samples, 34.64%)<alloc::sync::Arc<T> as rucene::core::codec::points::poi..<rucene::core::codec::points::points_reader::Lucene60PointsReader as rucene::core::codec::points::point_values::PointValues>::intersect (19,830 samples, 34.64%)<rucene::core::codec::points::points_reader::Lucene60Poi..?? (6 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)<alloc::sync::Arc<T> as rucene::core::codec::points::point_values::PointValues>::doc_count (8 samples, 0.01%)<rucene::core::codec::points::points_reader::Lucene60PointsReader as rucene::core::codec::points::point_values::PointValues>::doc_count (8 samples, 0.01%)rucene::core::codec::points::points_reader::Lucene60PointsReader::bkd_reader (8 samples, 0.01%)?? (13 samples, 0.02%)?? (7 samples, 0.01%)?? (7 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::build (7 samples, 0.01%)alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle (7 samples, 0.01%)alloc::raw_vec::RawVec<T,A>::grow_amortized (7 samples, 0.01%)alloc::raw_vec::finish_grow (7 samples, 0.01%)<alloc::alloc::Global as core::alloc::Allocator>::grow (7 samples, 0.01%)alloc::alloc::Global::grow_impl (7 samples, 0.01%)alloc::alloc::realloc (7 samples, 0.01%)__GI___libc_realloc (7 samples, 0.01%)_int_realloc (6 samples, 0.01%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::concat (17 samples, 0.03%)?? (16 samples, 0.03%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::build (9 samples, 0.02%)__memmove_avx_unaligned_erms (9 samples, 0.02%)rucene::core::util::doc_id_set_builder::DocIdSetBuilder::no_dups (72 samples, 0.13%)core::iter::range::<impl core::iter::traits::iterator::Iterator for core::ops::range::Range<A>>::next (27 samples, 0.05%)<core::ops::range::Range<T> as core::iter::range::RangeIteratorImpl>::spec_next (27 samples, 0.05%)core::cmp::impls::<impl core::cmp::PartialOrd for usize>::lt (27 samples, 0.05%)alloc::vec::from_elem (24 samples, 0.04%)<T as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (24 samples, 0.04%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (24 samples, 0.04%)?? (24 samples, 0.04%)?? (24 samples, 0.04%)?? (24 samples, 0.04%)rucene::core::util::sorter::LSBRadixSorter::sort (24 samples, 0.04%)__calloc (24 samples, 0.04%)_int_malloc (18 samples, 0.03%)malloc_consolidate (11 samples, 0.02%)rucene::core::util::sorter::LSBRadixSorter::sort (29 samples, 0.05%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (169 samples, 0.30%)rucene::core::util::sorter::LSBRadixSorter::build_histogram (304 samples, 0.53%)<i32 as rucene::core::util::bit_util::UnsignedShift>::unsigned_shift (38 samples, 0.07%)rucene::core::util::sorter::LSBRadixSorter::reorder (379 samples, 0.66%)<core::iter::adapters::take::Take<I> as core::iter::traits::iterator::Iterator>::next (57 samples, 0.10%)<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next (14 samples, 0.02%)<core::ptr::non_null::NonNull<T> as core::cmp::PartialEq>::eq (14 samples, 0.02%)<rucene::core::search::query::point_range_query::PointRangeWeight as rucene::core::search::query::Weight<C>>::create_scorer (20,782 samples, 36.31%)<rucene::core::search::query::point_range_query::PointRange..rucene::core::search::query::point_range_query::PointRangeWeight::build_matching_doc_set (20,710 samples, 36.18%)rucene::core::search::query::point_range_query::PointRangeW..rucene::core::util::doc_id_set_builder::DocIdSetBuilder::build (863 samples, 1.51%)rucene::core::util::sorter::LSBRadixSorter::sort (757 samples, 1.32%)rucene::core::util::sorter::LSBRadixSorter::sort_histogram (699 samples, 1.22%)rucene::core::util::sorter::LSBRadixSorter::sum_histogram (11 samples, 0.02%)malloc_consolidate (28 samples, 0.05%)alloc::sync::Arc<T,A>::drop_slow (44 samples, 0.08%)core::ptr::drop_in_place<rucene::core::util::bit_set::FixedBitSet> (41 samples, 0.07%)core::ptr::drop_in_place<alloc::vec::Vec<i64>> (41 samples, 0.07%)core::ptr::drop_in_place<alloc::raw_vec::RawVec<i64>> (41 samples, 0.07%)?? (41 samples, 0.07%)?? (41 samples, 0.07%)alloc::sync::Arc<T,A>::drop_slow (41 samples, 0.07%)_int_free (40 samples, 0.07%)core::ptr::drop_in_place<alloc::boxed::Box<dyn rucene::core::search::scorer::Scorer>> (50 samples, 0.09%)<core::result::Result<T,E> as core::ops::try_trait::Try>::branch (1,791 samples, 3.13%)<co..<alloc::sync::Arc<T,A> as core::ops::deref::Deref>::deref (12 samples, 0.02%)alloc::sync::Arc<T,A>::inner (12 samples, 0.02%)core::ptr::non_null::NonNull<T>::as_ref (12 samples, 0.02%)<rucene::core::util::doc_id_set::DocIdSetDocIterEnum as rucene::core::search::DocIterator>::next (7,618 samples, 13.31%)<rucene::core::util:..<rucene::core::util::doc_id_set::BitSetDocIterator<T> as rucene::core::search::DocIterator>::advance (10,674 samples, 18.65%)<rucene::core::util::doc_id_s..?? (1,417 samples, 2.48%)???? (1,417 samples, 2.48%)??<rucene::core::util::doc_id_set::DocIdSetDocIterEnum as rucene::core::search::DocIterator>::next (1,417 samples, 2.48%)<r..<rucene::core::util::doc_id_set::BitSetDocIterator<T> as rucene::core::search::DocIterator>::next (10,878 samples, 19.00%)<rucene::core::util::doc_id_se..<rucene::core::util::doc_id_set::DocIdSetDocIterEnum as rucene::core::search::DocIterator>::next (186 samples, 0.32%)<rucene::core::util::doc_id_set::DocIdSetDocIterEnum as rucene::core::search::DocIterator>::next (19 samples, 0.03%)<rucene::core::search::scorer::ConstantScoreScorer<T> as rucene::core::search::DocIterator>::next (18,323 samples, 32.01%)<rucene::core::search::scorer::ConstantScoreScorer<T..<rucene::core::search::query::point_range_query::PointDocIterEnum as rucene::core::search::DocIterator>::next (17,081 samples, 29.84%)<rucene::core::search::query::point_range_query:..<rucene::core::util::doc_id_set::DocIdSetDocIterEnum as rucene::core::search::DocIterator>::next (14,755 samples, 25.78%)<rucene::core::util::doc_id_set::DocIdSet..<rucene::core::util::doc_id_set::IntArrayDocIterator as rucene::core::search::DocIterator>::next (61 samples, 0.11%)<alloc::sync::Arc<T,A> as core::ops::deref::Deref>::deref (34 samples, 0.06%)alloc::sync::Arc<T,A>::inner (34 samples, 0.06%)core::ptr::non_null::NonNull<T>::as_ref (34 samples, 0.06%)<rucene::core::util::bits::MatchAllBits as rucene::core::util::bits::Bits>::get (1,604 samples, 2.80%)<r..?? (1,083 samples, 1.89%)??rucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score (1,083 samples, 1.89%)r..<rucene::core::search::scorer::ConstantScoreScorer<T> as rucene::core::search::scorer::Scorer>::score (1,477 samples, 2.58%)<r..?? (281 samples, 0.49%)rucene::core::search::collector::top_docs::TopDocsBaseCollector::add_doc (281 samples, 0.49%)?? (282 samples, 0.49%)?? (282 samples, 0.49%)alloc::collections::binary_heap::BinaryHeap<T,A>::len (36 samples, 0.06%)alloc::vec::Vec<T,A>::len (36 samples, 0.06%)?? (11,212 samples, 19.59%)??rucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score (10,129 samples, 17.70%)rucene::core::search::score..rucene::core::search::collector::top_docs::TopDocsBaseCollector::add_doc (5,765 samples, 10.07%)rucene::core::s..alloc::collections::binary_heap::BinaryHeap<T,A>::peek_mut (409 samples, 0.71%)<rucene::core::search::searcher::DefaultIndexSearcher<C,R,IR,SP> as rucene::core::search::searcher::IndexSearcher<C>>::search (56,131 samples, 98.06%)<rucene::core::search::searcher::DefaultIndexSearcher<C,R,IR,SP> as rucene::core::search::searcher::IndexSearcher<C>>::searchrucene::core::search::searcher::DefaultIndexSearcher<C,R,IR,SP>::do_search (35,293 samples, 61.66%)rucene::core::search::searcher::DefaultIndexSearcher<C,R,IR,SP>::do_searchrucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score (35,293 samples, 61.66%)rucene::core::search::scorer::bulk_scorer::BulkScorer<S>::scorerucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score_range (35,286 samples, 61.64%)rucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score_rangerucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score_range_in_docs_set (35,286 samples, 61.64%)rucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score_range_in_docs_setrucene::core::search::scorer::bulk_scorer::BulkScorer<S>::score (663 samples, 1.16%)alloc::string::String::len (10 samples, 0.02%)alloc::vec::Vec<T,A>::len (10 samples, 0.02%)core::str::converts::from_utf8 (10 samples, 0.02%)core::str::converts::from_utf8 (99 samples, 0.17%)core::str::validations::run_utf8_validation (52 samples, 0.09%)?? (9 samples, 0.02%)std::io::append_to_string (7 samples, 0.01%)__GI___libc_malloc (61 samples, 0.11%)__rdl_alloc (6 samples, 0.01%)alloc::raw_vec::finish_grow (91 samples, 0.16%)alloc::raw_vec::RawVec<T,A>::grow_amortized (108 samples, 0.19%)core::num::<impl usize>::checked_add (6 samples, 0.01%)core::num::<impl usize>::overflowing_add (6 samples, 0.01%)alloc::vec::Vec<T,A>::reserve (119 samples, 0.21%)alloc::raw_vec::RawVec<T,A>::reserve (118 samples, 0.21%)alloc::raw_vec::RawVec<T,A>::reserve::do_reserve_and_handle (110 samples, 0.19%)core::intrinsics::copy_nonoverlapping (29 samples, 0.05%)__memmove_avx_unaligned_erms (27 samples, 0.05%)alloc::vec::Vec<T,A>::append_elements (153 samples, 0.27%)alloc::vec::Vec<T,A>::extend_from_slice (172 samples, 0.30%)<alloc::vec::Vec<T,A> as alloc::vec::spec_extend::SpecExtend<&T,core::slice::iter::Iter<T>>>::spec_extend (154 samples, 0.27%)core::slice::index::<impl core::ops::index::Index<I> for [T]>::index (11 samples, 0.02%)<core::ops::range::RangeToInclusive<usize> as core::slice::index::SliceIndex<[T]>>::index (11 samples, 0.02%)<core::ops::range::RangeInclusive<usize> as core::slice::index::SliceIndex<[T]>>::index (11 samples, 0.02%)<std::io::Lines<B> as core::iter::traits::iterator::Iterator>::next (443 samples, 0.77%)std::io::append_to_string (443 samples, 0.77%)std::io::BufRead::read_line::_{{closure}} (288 samples, 0.50%)std::io::read_until (287 samples, 0.50%)std::sys_common::memchr::memchr (92 samples, 0.16%)std::sys::pal::unix::memchr::memchr (85 samples, 0.15%)__memchr_avx2 (71 samples, 0.12%)<std::io::Lines<B> as core::iter::traits::iterator::Iterator>::next (473 samples, 0.83%)core::iter::range::<impl core::iter::traits::iterator::Iterator for core::ops::range::Range<A>>::next (6 samples, 0.01%)<core::ops::range::Range<T> as core::iter::range::RangeIteratorImpl>::spec_next (6 samples, 0.01%)core::cmp::impls::<impl core::cmp::PartialOrd for i32>::lt (6 samples, 0.01%)__GI___libc_free (18 samples, 0.03%)core::ptr::drop_in_place<alloc::string::String> (75 samples, 0.13%)core::ptr::drop_in_place<alloc::vec::Vec<u8>> (75 samples, 0.13%)core::ptr::drop_in_place<alloc::raw_vec::RawVec<u8>> (75 samples, 0.13%)?? (75 samples, 0.13%)?? (75 samples, 0.13%)basic_points_range::main (75 samples, 0.13%)_int_free (50 samples, 0.09%)core::ptr::drop_in_place<alloc::vec::Vec<core::result::Result<alloc::boxed::Box<dyn rucene::core::search::query::Query<rucene::core::codec::CodecEnum>>,rucene::error::Error>>> (8 samples, 0.01%)?? (8 samples, 0.01%)basic_points_range::main (8 samples, 0.01%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::flush (6 samples, 0.01%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::do_flush (6 samples, 0.01%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::apply_all_deletes_and_update (6 samples, 0.01%)rucene::core::index::writer::bufferd_updates::BufferedUpdatesStream<C>::apply_deletes_and_updates (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)?? (6 samples, 0.01%)rucene::core::index::writer::bufferd_updates::BufferedUpdatesStream<C>::apply_deletes_and_updates (6 samples, 0.01%)__rdl_alloc (6 samples, 0.01%)std::sys::pal::unix::alloc::<impl core::alloc::global::GlobalAlloc for std::alloc::System>::alloc (6 samples, 0.01%)std::sys::pal::unix::alloc::aligned_malloc (6 samples, 0.01%)__posix_memalign (6 samples, 0.01%)_mid_memalign (6 samples, 0.01%)_int_memalign (6 samples, 0.01%)_int_malloc (6 samples, 0.01%)core::ptr::drop_in_place<rucene::core::index::writer::index_writer::IndexWriter<rucene::core::store::directory::fs_directory::FSDirectory,rucene::core::codec::CodecEnum,rucene::core::index::merge::merge_scheduler::SerialMergeScheduler,rucene::core::index::merge::merge_policy::TieredMergePolicy>> (7 samples, 0.01%)<rucene::core::index::writer::index_writer::IndexWriter<D,C,MS,MP> as core::ops::drop::Drop>::drop (7 samples, 0.01%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::shutdown (7 samples, 0.01%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::do_shutdown (7 samples, 0.01%)<core::slice::iter::Iter<T> as core::iter::traits::iterator::Iterator>::next (60 samples, 0.10%)<core::ptr::non_null::NonNull<T> as core::cmp::PartialEq>::eq (60 samples, 0.10%)<isize as core::num::FromStrRadixHelper>::from_u32 (49 samples, 0.09%)<isize as core::ops::arith::Mul>::mul (18 samples, 0.03%)core::char::methods::<impl char>::to_digit (52 samples, 0.09%)core::num::<impl u32>::wrapping_sub (47 samples, 0.08%)core::str::<impl str>::parse (227 samples, 0.40%)core::num::<impl core::str::traits::FromStr for i64>::from_str (220 samples, 0.38%)core::num::from_str_radix (217 samples, 0.38%)num_cpus::get_physical (7 samples, 0.01%)num_cpus::linux::get_num_physical_cpus (7 samples, 0.01%)<rucene::core::codec::doc_values::doc_values_format::DocValuesFormatEnum as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (11 samples, 0.02%)<rucene::core::codec::doc_values::lucene54::lucene54_doc_values_format::Lucene54DocValuesFormat as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (11 samples, 0.02%)rucene::core::codec::doc_values::lucene54::lucene54_doc_values_producer::Lucene54DocValuesProducer::new (11 samples, 0.02%)rucene::core::index::reader::segment_reader::SegmentReader<D,C>::build (19 samples, 0.03%)rucene::core::index::reader::segment_reader::SegmentReader<D,C>::new (19 samples, 0.03%)rucene::core::index::reader::segment_reader::SegmentReader<D,C>::get_dv_producer (12 samples, 0.02%)rucene::core::index::reader::segment_reader::SegmentDocValues::get_dv_producer (12 samples, 0.02%)rucene::core::index::reader::segment_reader::SegmentDocValues::do_get_dv_producer (12 samples, 0.02%)<rucene::core::codec::doc_values::doc_values_format::DocValuesFormatEnum as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (12 samples, 0.02%)<rucene::core::codec::doc_values::doc_values_format::PerFieldDocValuesFormat as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (12 samples, 0.02%)rucene::core::codec::doc_values::doc_values_format::DocValuesFieldsReader::new (12 samples, 0.02%)?? (6 samples, 0.01%)num_cpus::linux::get_num_physical_cpus (6 samples, 0.01%)std::fs::OpenOptions::_open (6 samples, 0.01%)std::sys::pal::unix::fs::File::open (6 samples, 0.01%)std::sys::pal::common::small_c_string::run_path_with_cstr (6 samples, 0.01%)std::sys::pal::common::small_c_string::run_with_cstr (6 samples, 0.01%)std::sys::pal::unix::fs::File::open::_{{closure}} (6 samples, 0.01%)std::sys::pal::unix::fs::File::open_c (6 samples, 0.01%)std::sys::pal::unix::cvt_r (6 samples, 0.01%)std::sys::pal::unix::fs::File::open_c::_{{closure}} (6 samples, 0.01%)__libc_open64 (6 samples, 0.01%)num_cpus::get_physical (17 samples, 0.03%)num_cpus::linux::get_num_physical_cpus (17 samples, 0.03%)<rucene::core::codec::doc_values::doc_values_format::DocValuesFormatEnum as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (11 samples, 0.02%)<rucene::core::codec::doc_values::lucene54::lucene54_doc_values_format::Lucene54DocValuesFormat as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (11 samples, 0.02%)rucene::core::codec::doc_values::lucene54::lucene54_doc_values_producer::Lucene54DocValuesProducer::new (11 samples, 0.02%)rucene::core::index::writer::index_writer::IndexWriter<D,C,MS,MP>::get_reader (52 samples, 0.09%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::get_reader (52 samples, 0.09%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::do_get_reader (52 samples, 0.09%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::flush_and_open (52 samples, 0.09%)rucene::core::index::reader::directory_reader::StandardDirectoryReader<D,C,MS,MP>::open_by_writer (52 samples, 0.09%)rucene::core::index::writer::index_writer::ReadersAndUpdates<D,C,MS,MP>::get_readonly_clone (51 samples, 0.09%)rucene::core::index::writer::index_writer::ReadersAndUpdatesInner<D,C,MS,MP>::get_readonly_clone (51 samples, 0.09%)rucene::core::index::writer::index_writer::ReadersAndUpdatesInner<D,C,MS,MP>::create_reader_if_not_exist (32 samples, 0.06%)rucene::core::index::reader::segment_reader::SegmentReader<D,C>::open (32 samples, 0.06%)rucene::core::index::reader::segment_reader::SegmentReader<D,C>::new (30 samples, 0.05%)rucene::core::index::reader::segment_reader::SegmentReader<D,C>::get_dv_producer (13 samples, 0.02%)rucene::core::index::reader::segment_reader::SegmentDocValues::get_dv_producer (13 samples, 0.02%)rucene::core::index::reader::segment_reader::SegmentDocValues::do_get_dv_producer (13 samples, 0.02%)<rucene::core::codec::doc_values::doc_values_format::DocValuesFormatEnum as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (13 samples, 0.02%)<rucene::core::codec::doc_values::doc_values_format::PerFieldDocValuesFormat as rucene::core::codec::doc_values::doc_values_format::DocValuesFormat>::fields_producer (13 samples, 0.02%)rucene::core::codec::doc_values::doc_values_format::DocValuesFieldsReader::new (13 samples, 0.02%)alloc::vec::from_elem (8 samples, 0.01%)<u8 as alloc::vec::spec_from_elem::SpecFromElem>::from_elem (8 samples, 0.01%)alloc::raw_vec::RawVec<T,A>::with_capacity_zeroed_in (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)?? (8 samples, 0.01%)rucene::core::search::query::point_range_query::LongPoint::pack (8 samples, 0.01%)__calloc (8 samples, 0.01%)rucene::core::search::query::point_range_query::LongPoint::pack (10 samples, 0.02%)__libc_start_main (57,023 samples, 99.62%)__libc_start_mainmain (57,023 samples, 99.62%)mainstd::rt::lang_start_internal (57,023 samples, 99.62%)std::rt::lang_start_internalstd::panic::catch_unwind (57,023 samples, 99.62%)std::panic::catch_unwindstd::panicking::try (57,023 samples, 99.62%)std::panicking::trystd::panicking::try::do_call (57,023 samples, 99.62%)std::panicking::try::do_callstd::rt::lang_start_internal::_{{closure}} (57,023 samples, 99.62%)std::rt::lang_start_internal::_{{closure}}std::panic::catch_unwind (57,023 samples, 99.62%)std::panic::catch_unwindstd::panicking::try (57,023 samples, 99.62%)std::panicking::trystd::panicking::try::do_call (57,023 samples, 99.62%)std::panicking::try::do_callcore::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once (57,023 samples, 99.62%)core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_oncestd::rt::lang_start::_{{closure}} (57,023 samples, 99.62%)std::rt::lang_start::_{{closure}}std::sys_common::backtrace::__rust_begin_short_backtrace (57,023 samples, 99.62%)std::sys_common::backtrace::__rust_begin_short_backtracecore::ops::function::FnOnce::call_once (57,023 samples, 99.62%)core::ops::function::FnOnce::call_oncebasic_points_range::main (57,023 samples, 99.62%)basic_points_range::mainrucene::core::search::query::point_range_query::LongPoint::new_range_query (18 samples, 0.03%)rucene::core::search::query::point_range_query::LongPoint::new_multi_range_query (18 samples, 0.03%)_start (57,033 samples, 99.64%)_startrucene::core::codec::segment_infos::segment_infos::SegmentInfos<D,C>::read_commit (7 samples, 0.01%)rucene::core::codec::segment_infos::segment_infos::SegmentInfos<D,C>::read_commit_generation (7 samples, 0.01%)<rucene::core::codec::segment_infos::segment_infos_format::Lucene62SegmentInfoFormat as rucene::core::codec::segment_infos::segment_infos_format::SegmentInfoFormat>::read (7 samples, 0.01%)rucene::core::codec::segment_infos::segment_infos_format::read_segment_info_from_index (7 samples, 0.01%)rucene::core::codec::segment_infos::SegmentInfo<D,C>::set_files (7 samples, 0.01%)rucene::core::codec::segment_infos::SegmentInfo<D,C>::add_files (7 samples, 0.01%)rucene::core::codec::segment_infos::SegmentInfo<D,C>::check_file_name (7 samples, 0.01%)regex::re_unicode::Regex::new (7 samples, 0.01%)regex::re_unicode::Regex::new (7 samples, 0.01%)regex::exec::ExecBuilder::build (7 samples, 0.01%)all (57,241 samples, 100%)basic_points_ra (57,241 samples, 100.00%)basic_points_rarucene::core::index::writer::index_writer::IndexWriter<D,C,MS,MP>::new (10 samples, 0.02%)rucene::core::index::writer::index_writer::IndexWriterInner<D,C,MS,MP>::new (10 samples, 0.02%) \ No newline at end of file diff --git a/src/core/codec/postings/blocktree/blocktree_reader.rs b/src/core/codec/postings/blocktree/blocktree_reader.rs index 3ed1e6e..6739623 100644 --- a/src/core/codec/postings/blocktree/blocktree_reader.rs +++ b/src/core/codec/postings/blocktree/blocktree_reader.rs @@ -618,60 +618,59 @@ impl Stats { Stats { index_num_bytes: 0, - /// Total number of terms in the field. + // Total number of terms in the field. total_term_count: 0, - /// Total number of bytes (sum of term lengths) across all terms in the - /// field. + // Total number of bytes (sum of term lengths) across all terms in the field. total_term_bytes: 0, // TODO: add total auto-prefix term count - /// The number of normal (non-floor) blocks in the terms file. + // The number of normal (non-floor) blocks in the terms file. non_floor_block_count: 0, - /// The number of floor blocks (meta-blocks larger than the - /// allowed {@code maxItemsPerBlock}) in the terms file. + // The number of floor blocks (meta-blocks larger than the + // allowed {@code maxItemsPerBlock}) in the terms file. floor_block_count: 0, - /// The number of sub-blocks within the floor blocks. + // The number of sub-blocks within the floor blocks. floor_sub_block_count: 0, - /// The number of "internal" blocks (that have both - /// terms and sub-blocks). + // The number of "internal" blocks (that have both + // terms and sub-blocks). mixed_block_count: 0, - /// The number of "leaf" blocks (blocks that have only - /// terms). + // The number of "leaf" blocks (blocks that have only + // terms). terms_only_block_count: 0, - /// The number of "internal" blocks that do not contain - /// terms (have only sub-blocks). + // The number of "internal" blocks that do not contain + // terms (have only sub-blocks). sub_blocks_only_block_count: 0, - /// Total number of blocks. + // Total number of blocks. total_block_count: 0, - /// Number of blocks at each prefix depth. + // Number of blocks at each prefix depth. block_count_by_prefix_len: vec![0 as i32; 10], start_block_count: 0, end_block_count: 0, - /// Total number of bytes used to store term suffixes. + // Total number of bytes used to store term suffixes. total_block_suffix_bytes: 0, - /// Total number of bytes used to store term stats (not - /// including what the {@link PostingsReaderBase} - /// stores. + // Total number of bytes used to store term stats (not + // including what the {@link PostingsReaderBase} + // stores. total_block_stats_bytes: 0, - /// Total bytes stored by the {@link PostingsReaderBase}, - /// plus the other few vInts stored in the frame. + // Total bytes stored by the {@link PostingsReaderBase}, + // plus the other few vInts stored in the frame. total_block_other_bytes: 0, - /// Segment name. + // Segment name. segment: String::from(segment), - /// Field name. + // Field name. field: String::from(field), } } diff --git a/src/core/util/external/thread_pool.rs b/src/core/util/external/thread_pool.rs index 03cdf60..5193530 100644 --- a/src/core/util/external/thread_pool.rs +++ b/src/core/util/external/thread_pool.rs @@ -381,7 +381,7 @@ mod test { // current task may be still running. assert!( left_num == task_num || left_num == task_num - 1, - format!("left_num {},task_num {}", left_num, task_num) + "left_num {},task_num {}", left_num, task_num ); task_num -= 1; }