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
C#: Use synthetic global in the EntityFramework code instead of jump steps. #13147
C#: Use synthetic global in the EntityFramework code instead of jump steps. #13147
Conversation
68a9fde
to
a9f795e
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.
Approach LGTM.
csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll
Outdated
Show resolved
Hide resolved
73ff0df
to
7542f6c
Compare
|
There appears to be a severe both cache and performance degradation for .NET EFCore with these changes. |
…es that uses synthetic globals.
…ork implementation.
7542f6c
to
d882fe1
Compare
|
@hvitved : Ready for review. Thank you for the help with the performance issue! You were absolute right - we could just narrow the synthetic field names to the only absolutely necessary - that solved everything! |
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.
A few comments; glad to hear that the refactor worked.
csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll
Outdated
Show resolved
Hide resolved
csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll
Outdated
Show resolved
Hide resolved
csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll
Outdated
Show resolved
Hide resolved
csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll
Outdated
Show resolved
Hide resolved
csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll
Outdated
Show resolved
Hide resolved
f6dd979
to
6294e52
Compare
6294e52
to
9690ff6
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.
A few minor comments, otherwise LGTM. We should also get rid of the old JumpReturnKind stuff, right?
csharp/ql/lib/semmle/code/csharp/frameworks/EntityFramework.qll
Outdated
Show resolved
Hide resolved
There is a follow up for that: #13150 |
|
DCA still looks good. |
In this PR we replace the use of jump steps with synthetic globals in the Entity Framework code.
The idea is that if we have a summary
for a callable
cwhere we have flow fromAtoBand whereBinvolves a jump step topthen we can replace this summary by two summariesHowever, it is important that
Sis unique for each target path of a summary to avoid collision.We can generate
Sbased on{p, B}to ensure that we avoid collisions (due to the global nature of synthetics).Some explanation of the new summaries.
Prior to the change there was a total of 116 summaries (as shown by the test).
After the change there is total of 143 summaries.
If we inspect the old summaries there are are total of 26 different target paths (all of them involving jumps to a property).
If we inspect the new summaries we see that there 26 summaries related to properties - each corresponding to a different target in the old summaries. Furthermore, the new summaries contain 116 summaries that write to the synthetics that the 26 properties read from. This should provide some justification that we have achieved equivalence.
DCA looks good.