return Sc::zero() for unchanged#47
Closed
NewBornRustacean wants to merge 1 commit intoSolverForge:mainfrom
Closed
Conversation
Collaborator
|
Hey @NewBornRustacean, good point! These days I was refactoring the codebase for smaller LOC per file, but didn't push it here, yet. The code you fixed is now in: I think it's easier if you submit a new PR to the updated main branch, so you don't lose commit history. Will be happy to merge immediately. Closing this one - thank you! |
Contributor
Author
|
yebb 👍 will open a new one with proper tests! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello @blackopsrepl 😃
I was looking into the scoring side today and found a place where an early return seemed useful.
Changes
Add an early return in
IncrementalCrossBiConstraint::on_insertwhen the changed descriptor does not affect either a and b. This avoids callingextractor_a.extract(solution)andextractor_b.extract(solution)for unrelated descriptor changes.Expected Impact
Reduces unnecessary work in the incremental scoring hot path during local search candidate evaluation. This should help multi-descriptor problems with multiple constraints, where many entity changes may be irrelevant to a given cross-bi constraint.