Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

No score calls if score is not requested #1646

Merged
merged 4 commits into from
Nov 1, 2022
Merged

No score calls if score is not requested #1646

merged 4 commits into from
Nov 1, 2022

Conversation

PSeitz
Copy link
Contributor

@PSeitz PSeitz commented Oct 26, 2022

Those score calls can add add up in cost

@PSeitz PSeitz requested a review from fulmicoton October 26, 2022 01:21
@@ -7,12 +7,21 @@ use crate::{DocId, Score, TERMINATED};
/// `DocSet` and push the scored documents to the collector.
pub(crate) fn for_each_scorer<TScorer: Scorer + ?Sized>(
scorer: &mut TScorer,
requires_scoring: bool,
Copy link
Collaborator

@fulmicoton fulmicoton Oct 26, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not add this parameter to this function and instead create a separate function:

pub(crate) fn for_each_docset<TDocSet: DocSet + ?Sized>(
    docset: &mut TDocset,
    callback: &mut dyn FnMut(DocId)
) -> { ... }

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the PR, but it still adds a fake score when collect()ing

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2022

Codecov Report

Merging #1646 (2af6b01) into main (c24157f) will increase coverage by 0.06%.
The diff coverage is 93.06%.

@@            Coverage Diff             @@
##             main    #1646      +/-   ##
==========================================
+ Coverage   93.97%   94.04%   +0.06%     
==========================================
  Files         253      255       +2     
  Lines       47716    48616     +900     
==========================================
+ Hits        44843    45720     +877     
- Misses       2873     2896      +23     
Impacted Files Coverage Δ
fastfield_codecs/src/main.rs 0.51% <0.00%> (-0.02%) ⬇️
src/fastfield/writer.rs 88.52% <0.00%> (ø)
src/indexer/sorted_doc_id_multivalue_column.rs 95.00% <0.00%> (ø)
src/query/bitset/mod.rs 99.45% <ø> (ø)
src/query/mod.rs 100.00% <ø> (ø)
src/fastfield/multivalued/writer.rs 98.86% <50.00%> (ø)
src/schema/field_type.rs 77.52% <50.00%> (+1.10%) ⬆️
src/fastfield/multivalued/reader.rs 83.17% <60.00%> (-2.40%) ⬇️
src/collector/mod.rs 47.75% <66.66%> (-0.47%) ⬇️
src/indexer/sorted_doc_id_column.rs 95.00% <66.66%> (ø)
... and 44 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

src/query/weight.rs Outdated Show resolved Hide resolved
reader: &SegmentReader,
callback: &mut dyn FnMut(DocId),
) -> crate::Result<()> {
let scorer = self.complex_scorer(reader, 1.0, &self.score_combiner_fn)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does &DoNothingCombiner make sense here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, but it's not called anyway

@PSeitz PSeitz merged commit 0f98d91 into main Nov 1, 2022
@PSeitz PSeitz deleted the no_score_calls branch November 1, 2022 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants