C++: Add nomagic to Function::getParameter#20854
Merged
MathiasVP merged 1 commit intogithub:mainfrom Nov 18, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds nomagic pragmas to two parameter-related predicates in the Function class to prevent inefficient join operations. The change addresses a performance issue where magic optimization was causing a join-on-index problem in Function::getParameter.
Key Changes
- Added
pragma[nomagic]toFunction::getParameter(int n)to prevent magic optimization from creating inefficient join patterns - Added
pragma[nomagic]toFunction::getAParameter()for consistency and to prevent similar performance issues
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jketema
approved these changes
Nov 17, 2025
Contributor
jketema
left a comment
There was a problem hiding this comment.
Looks sensible. I'm happy if DCA is happy.
Contributor
|
Sorry... I am that person who didn't have the log :-) My editor OOMed during the experiments and I think it wiped all the logs. |
Contributor
Author
|
DCA was uneventful. At first I thought there was a large speedup, but then I realized it was on the macos project only 😭 |
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.
Magic was giving us the dreaded join-on-index in
Function::getParameter. Sadly, the person who was getting this issue didn't save an evaluator log for me, but they did manage to share this very useful screenshot 😅