Skip to content
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

Merged
merged 11 commits into from Jun 14, 2023

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented May 12, 2023

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

c : A -> B[jump p]

for a callable c where we have flow from A to B and where B involves a jump step to p then we can replace this summary by two summaries

c : A -> S
p : S -> B

However, it is important that S is unique for each target path of a summary to avoid collision.
We can generate S based 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.

Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach LGTM.

@michaelnebel michaelnebel force-pushed the csharp/entityframeworkrefactor branch 2 times, most recently from 73ff0df to 7542f6c Compare May 31, 2023 07:00
@michaelnebel michaelnebel requested a review from hvitved May 31, 2023 08:07
@michaelnebel
Copy link
Contributor Author

There appears to be a severe both cache and performance degradation for .NET EFCore with these changes.
Will run DCA again to see if this is just a glitch.

@michaelnebel michaelnebel force-pushed the csharp/entityframeworkrefactor branch from 7542f6c to d882fe1 Compare June 1, 2023 07:30
@michaelnebel
Copy link
Contributor Author

@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!

Copy link
Contributor

@hvitved hvitved left a 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.

@michaelnebel michaelnebel force-pushed the csharp/entityframeworkrefactor branch 2 times, most recently from f6dd979 to 6294e52 Compare June 13, 2023 11:53
@michaelnebel michaelnebel force-pushed the csharp/entityframeworkrefactor branch from 6294e52 to 9690ff6 Compare June 13, 2023 12:19
Copy link
Contributor

@hvitved hvitved left a 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?

@michaelnebel
Copy link
Contributor Author

A few minor comments, otherwise LGTM. We should also get rid of the old JumpReturnKind stuff, right?

There is a follow up for that: #13150

@michaelnebel
Copy link
Contributor Author

DCA still looks good.

@michaelnebel michaelnebel added the no-change-note-required This PR does not need a change note label Jun 14, 2023
@michaelnebel michaelnebel marked this pull request as ready for review June 14, 2023 09:38
@michaelnebel michaelnebel requested review from a team as code owners June 14, 2023 09:38
@michaelnebel michaelnebel merged commit afec9b0 into github:main Jun 14, 2023
50 checks passed
@michaelnebel michaelnebel deleted the csharp/entityframeworkrefactor branch June 14, 2023 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants