-
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
System.Diagnostics.StackTrace slow on .NET Core #10209
Comments
@dotnet/dotnet-diag @tommcdon |
All of these classes get disposed when
|
@0xd4d Not sure how this is handled in the .NET framework but I assume that they cache this somehow. |
I haven't checked since it was so fast, so I assume .NET Framework uses a cache. |
Strong suspicion you are seeing this issue microsoft/dotnet#529. A fix was made for desktop and it needs to be brought to CoreCLR. |
Should this be considered for 2.1? Seems like a significant regression. |
The performance now is the same behavior we shipped in CoreCLR RTM 2.0 (based on my memory of when the changes happened and @martinmine's report of the performance above). The regression is relative to desktop, and maybe relative to .Net Core 1.0. I do think it would be worth considering this for 2.1. |
Fixed in PR dotnet/corefx#29359 and PR dotnet/coreclr#17804 |
@noahfalk @mikem8361 In which version(s) of .NET Core will we be seeing this get patched in? |
Currently version 2.2. @Petermarcu @leecow @tommcdon Does this meet the 2.1 bug bar? |
Worth having a discussion about risk/reward. Clearly writing down the E2E scenarios that are impacted by this so everyone understands the value in taking the fix late in 2.1 will help make or break the case for it. |
The main E2E scenarios is the use of System.Diagnostics.StackTrace or System.Exception.StackTrace to log source/line number info is certain frameworks like SharpDX, GrandTheftAuto mod (520727), IKVM library used in Belgium, etc. on the desktop. More details in issue #529. These changes have been in 4.7.2 or 4.7.3 since the holidays. This is backporting the changes to .NET Core so we don’t run into similar problems. |
Consider the following program:
This takes 4133.3539 ms in .NET Core 2.0, while targeting .NET 4.7.1 this takes 108.1025 ms to execute. Making a full dump on this with procdump, I can see the following stack trace typically being called:
The text was updated successfully, but these errors were encountered: