-
Notifications
You must be signed in to change notification settings - Fork 394
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
Remove Unused Var6 from PerformanceCurveObject #8798
Remove Unused Var6 from PerformanceCurveObject #8798
Conversation
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.
Is this all we need to do here? I can probably add some unit tests since I'm guessing we may not have full coverage on this, but is this the extent of what this was intended to fix?
It seems dangerous that we are allowing 6 vars to be passed into CurveValue
, then switching inside based on whether we have a curve or a table, which respectively accept 5 or 6 vars. Maybe we need a check, but by that point, it's probably just as efficient to optionally pass the 6th var rather than hitting a check every time.
I'm open to suggestions on this.
switch (state.dataCurveManager->PerfCurve(CurveIndex).InterpolationType) { | ||
case InterpTypeEnum::EvaluateCurveToLimits: { | ||
CurveValue = PerformanceCurveObject(state, CurveIndex, Var1, Var2, Var3, Var4, Var5); | ||
break; | ||
} | ||
case InterpTypeEnum::BtwxtMethod: { | ||
CurveValue = BtwxtTableInterpolation(state, CurveIndex, Var1, Var2, Var3, Var4, Var5, Var6); | ||
break; | ||
} | ||
default: | ||
ShowFatalError(state, "CurveValue: Invalid Interpolation Type"); | ||
} |
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.
Changed this from an IF/ELSE to a switch block since we already have enums.
} | ||
switch (state.dataCurveManager->PerfCurve(CurveIndex).InterpolationType) { | ||
case InterpTypeEnum::EvaluateCurveToLimits: { | ||
CurveValue = PerformanceCurveObject(state, CurveIndex, Var1, Var2, Var3, Var4, Var5); |
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.
Var6
was removed.
I'm on board here, this is good. Building and testing locally with develop pulled in. |
Am I interpreting the results correctly that this increased runtime by 3%? |
Oh wait, sorry. That SHA is from 19 days ago. I'm not sure what the issue would be then. |
Oh, you're right, it does say -0.3%. Huh. I must have misread it. |
One thing: the entire set of Github-Pages backed posts are rebuilt every time the CI dashboard rebuilds. So IIUC, the performance numbers there will reflect an updated baseline, which now includes a bunch of other stuff, some of which had significant improvements in runtime. Two things: We need to keep in mind that the performance values on there are good for throwing up warning flags if some refactor or new feature inadvertently increases runtime. But it's not a direct representation of wall time. We actually have a plan starting to get worked up for how to better represent actual wall time in a reliable, repeatable way, but it's not ready yet. Three things, ah ah ah; on this particular PR, it's quite obvious that nothing was done to increase runtime. This reduced a variable that was simply in the way and I cannot fathom how it could've increased runtime. I pulled develop in locally and built and ran the full integration and unit test suite. All is well. Merging this in. Thanks @mitchute ! |
Pull request overview
Pull Request Author
Add to this list or remove from it as applicable. This is a simple templated set of guidelines.
Reviewer
This will not be exhaustively relevant to every PR.