-
Notifications
You must be signed in to change notification settings - Fork 199
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
Fix double comp #646
Fix double comp #646
Conversation
@@ -611,7 +612,7 @@ private Optional<TaskExecutorGroupKey> findBestGroupByFitnessCalculator(Scheduli | |||
// one with size and one without. Due to this, issues may arise during task migrations as it's not | |||
// predictable which TEs will be chosen by the scheduler. While, instead, we want to always use TEs from the latest ASGs. | |||
.sorted((entry1, entry2) -> { | |||
int fitnessComparison = entry2.getValue().compareTo(entry1.getValue()); | |||
int fitnessComparison = DoublePrecisionComparator.compare(entry2.getValue(), entry1.getValue()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: unit test
public static int compare(Double value1, Double value2) { | ||
double valueDifference = value1 - value2; | ||
|
||
if (Math.abs(valueDifference) < 1E-14) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
btw do we need such high precision on these?
51737d9
to
988abfa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Context
Explain context and other details for this pull request.
Checklist
./gradlew build
compiles code correctly./gradlew test
passes all tests