Modify AvTrace call chain to use params ReadOnlySpan<object> instead of an array
Fixes #9467 Reference #9463
Description
More of a complex fix, modifies the call chain to make use of the latest .NET features.
- ~~I've used
Span<object>instead ofReadOnlySpan<object>as theparametersarray has always been mutated by the trace class, hence I didn't want to currently change the behaviour.~~ - Builds on the original intention of #6700
- The fixes should be compatible with my other PR too, #9361 and #9352.
-
ArrayListreplaced with pre-allocated array and used interpolation for building the trace data. - Modifies the
AvTraceMessages.ttfor completion. - The overall cost of
AvTrace/AvTraceMessageswill be greatly reduced.
Customer Impact
Improved performance when tracing is active, decreased array allocations per each executed trace, smaller assemblies due to the function removal.
Regression
Fixes the ref held by _traceArguments from #6700
Testing
Local build, app run with tracing, comparing outputs of release/PR.
Risk
Low, the actual change is small and was reviewed/tested.
Microsoft Reviewers: Open in CodeFlow
Hi there! Could you please update us on the status of this pull request? It's important for DevExpress components, and we're eager to know if you plan to merge it.
Hey @Alexgoon, I'm gonna CC a few guys from the wpf team just to be sure it doesn't get lost.
cc @pchaurasia14 @dipeshmsft
Hi again, I see the merging process has started - thanks for that! However, it looks like it’s stalled. Could you let me know if you plan to include this PR in the upcoming .NET 9 release?
@Alexgoon - We will be including this PR for upcoming test cycles, and it will go in for .NET 10.
@pchaurasia14, thanks for the clarification! We were hoping the PR would be merged into .NET 9 since it addresses the issue described in #9467, which surfaced in .NET 9. After migrating to the latest version, a lot of our memory-related tests started failing.
I also noticed another PR (#9463) that might help resolve the memory leak issue. Do you have any plans to merge it into .NET 9, or will the memory issue (#9467) be handled as part of another fix?
@siagupta0202 Any news on this one?
@siagupta0202 Any news on this one?
Hey @h3xds1nz, I was involved with some other tasks so couldn't take a look at this PR. I will review this soon.
@siagupta0202 Rebased so we can get this done finally.
Codecov Report
Attention: Patch coverage is 7.69231% with 60 lines in your changes missing coverage. Please review.
Project coverage is 10.96633%. Comparing base (
2ded801) to head (a63706b). Report is 4 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9468 +/- ##
===================================================
+ Coverage 10.95887% 10.96633% +0.00746%
===================================================
Files 3310 3310
Lines 664667 664388 -279
Branches 74667 74666 -1
===================================================
+ Hits 72840 72859 +19
+ Misses 590685 590389 -296
+ Partials 1142 1140 -2
| Flag | Coverage Δ | |
|---|---|---|
| Debug | 10.96633% <7.69231%> (+0.00746%) |
:arrow_up: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
LGTM, @h3xds1nz can you resolve the merge conflicts?
@siagupta0202 Done, sorry for the delay :)
@h3xds1nz Thank you so much for your contribution!
@siagupta0202 So happy to see this one in :) Thanks!