-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Reduced .NET8 R2R performance #96242
Comments
cc: @trylek |
Any comments on this issue? |
@ivdiazsa please run this through the ringer and see if you get the same results. |
Looks like in .NET 8 there is one method with unusually long jitting time (found via the jit stats tab of a perfview run) that likely accounts for the startup time issue you're seeing: that method does not appear in the .NET 6 jit stats, so presumably it was prejitted in .NET 6 but not in .NET 8. So the question is, why doesn't that method get prejitted in .NET 8? That will take a bit more digging. |
Seems like per r2r dump the method does get prejitted, so perhaps the runtime is deciding the method can't be used for some reason? (runtime might also toss the entire R2R payload). There is an ETW bit in the method load event for this, but perfview doesn't parse it yet in the raw payload. |
Thank you very much for the insight Andy. What might be the possible reasons the runtime might decide that and discard everything? And how would we investigate such a case? |
In order to use R2R code, the runtime performs a number of checks to decide if the prejitted image (as a whole) and then each individual method within that image can be safely used in the new run. Looks like setting
@VSadov @jkotas can you share the right diagnostic steps to try at this point? |
Pass
Then run crossgen2 under debugger to figure our what went wrong. You should see an exception thrown at this callstack:
@ivdiazsa You should be able to take it from here. |
@ivdiazsa I see that you have modified the milestone to 10.0. The |
@ivdiazsa, for us, labling this 10.0, makes the prospect of moving from net6.0-lts problematic. Either we stay=) insecure or we move to net8.0 =) slow. |
This is something we'll prioritize now and is highly likely to make its way back to net8. |
Thanks a lot for the detailed explanation and guidance @jkotas. Will prioritize it and get to investigate it on Monday. |
@JensNordenbro Hi, we've been researching and are currently developing a fix. While investigating, we found that your repro app has an |
Hi @ivdiazsa ! I will try to schedule a real investigation on the real app but I think it might take some time before we get to that. (summer, ...)
Nice to see progress! |
Hi @JensNordenbro! We've finished working on the fix and will soon begin working on the backport to .NET 8. |
The backport has been successfully completed. The fix will be available on the .NET 8.0.10 release. |
Thanks @ivdiazsa! |
Description
On arm64, using PublishReadyToRun on the attached project; you will get reduced performance using .NET8 (not present in NET7, NET6).
On my machine:
NET6: 10ms
NET8: 650ms
To help you guys get started, we have extracted a minimal reproduce project that triggers the error from a real application if you wonder why the app has no apparent purpose.
Changing from struct to class on Point2D will remove the problem.
Arm64Net8JitError.zip
Reproduction Steps
Start program published with parameter PublishReadyToRun:true and press the one button and get a messagebox with the init time to spot the difference.
Expected behavior
Non regressed performance.
Actual behavior
Really bad performance -> real world applicaton starts 10 times slower. Attached benchmark app is even slower than that.
Regression?
Yes, works in NET6.0, NET7.0
Known Workarounds
Convert Point2D struct to class instead.
Configuration
See description.
Other information
We target imx8MPlus.
The text was updated successfully, but these errors were encountered: