-
Notifications
You must be signed in to change notification settings - Fork 60
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
Performance improvements since upgrade to 2.16.6 #781
Conversation
Modify the `Compatible.qll` library to improve performance by restricting to function declarations for the same function. Adopt the Compatible library in DCL40-C, which has also improved detection of compatible types.
Hint optimizer to perform join of exclusions after determining results.
Refactored calculation to work top down, instead of bottom up, which ensures we are always comparing elements from within the same initializer.
/test-performance |
🏁 Beep Boop! Performance testing for this PR has been initiated. Please check back later for results. Note that the query package generation step must complete before testing will start so it might be a minute. |
🏁 Beep Boop! Performance testing complete! See below for performance of the last 3 runs vs your PR. Times are based on predicate performance. You can find full graphs and stats in the PR that was created for this test in the release engineering repo.
🏁 Below are the slowest predicates for the last 2 releases vs this PR.
|
Publishing a re-formatted table of total serialized time (in seconds) for easier review:
With these changes performance is slightly improved for C (4% decrease) and a more significant improvement for C++ (10% decrease) vs. the last release (and a significant performance improvement on both since v2.35.0). @knewbury01 this should address the slow performance we saw in the 2.37.0 release candidate. |
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.
@lcartey only one small accidental commented out code to remove
otherwise this all looks good to me
c/misra/src/rules/RULE-9-4/RepeatedInitializationOfAggregateObjectElement.ql
Outdated
Show resolved
Hide resolved
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!
Description
Addresses some performance issues noted in the upgrade to 2.16.6:
Compatible.qll
library, and ensuring all predicates are appropriately bound.isExcluded
mechanism was causing bad join orders. These have been addressed on a case-by-base basis.RULE-9-4
has been modified to perform a top-down, rather than bottom-up, detection of pairs of expressions initializing the same element in an array aggregate literal. This reduces the cases significantly.The performance logs for 2.16.6 still note some increases, particularly in the calculation of standard library features such as the IR. I suggest we re-trigger performance analysis on this PR and see whether they replicate.
Change request type
.ql
,.qll
,.qls
or unit tests)Rules with added or modified queries
DCL40-C
RULE-5-1
RULE-8-3
RULE-8-4
MSC39-C
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
Query development review checklist
For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:
Author
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
Reviewer
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.