-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
NativeRuntimeEventSource is too slow initialized #60963
Comments
Tagging subscribers to this area: @tarekgh, @tommcdon, @pjanotti Issue DetailsWe have moved PowerShell 7.2 RC to latest pre-RTM .Net 6.0 build and I see 20% perf win in startup scenario vs PowerShell 7.1 based on .Net 5.0. Thanks .Net team for great work! Nevertheless I still see in PerfView that There is related issue #44713. Too bad it wasn't fixed in the #45121. :-(
|
There's a catch-22 here: the costs you're seeing mostly only show up as part of running a trace, as it's the act of enabling ETW that's causing the EventSource to generate and output its manifest, which in turn is what's triggering it to use reflection to walk itself. So these costs generally don't show up in real usage and only appear because you're looking at it. The answer here isn't to try to make getting attributes faster, it's to avoid needing to do it at all. #49659 tracks that. |
PowerShell uses System.Diagnostics.Tracing at startup too and I hope it can benefit if GetCustomAttributes will be faster. |
Do you mean it has its own EventSource? That would be covered by an EventSource source generator as well. |
Yes, 3 at least. And yes, I hope PowerShell could benefit from source generators. |
Right. That's covered by the other issues. I'll close this then. |
We have moved PowerShell 7.2 RC to latest pre-RTM .Net 6.0 build and I see 20% perf win in startup scenario vs PowerShell 7.1 based on .Net 5.0. Thanks .Net team for great work!
Nevertheless I still see in PerfView that
System.Diagnostics.Tracing.NativeRuntimeEventSource::.cctor()
is noticeable slow - in my test it is 12% in PowerShell startup scenario. (Trace file PerfViewData-7.2-Startup-Exit.speedscope.json.zip )It seems a root of the issue
System.Attribute::GetCustomAttributes(System.Reflection.MemberInfo, System.Type, System.Boolean)
is slow.There is related issue #44713. Too bad it wasn't fixed in the #45121. :-(
The text was updated successfully, but these errors were encountered: