wpf icon indicating copy to clipboard operation
wpf copied to clipboard

Modify AvTrace call chain to use params ReadOnlySpan<object> instead of an array

Open h3xds1nz opened this issue 1 year ago • 5 comments

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 of ReadOnlySpan<object> as the parameters array 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.
  • ArrayList replaced with pre-allocated array and used interpolation for building the trace data.
  • Modifies the AvTraceMessages.tt for completion.
  • The overall cost of AvTrace / AvTraceMessages will 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

h3xds1nz avatar Jul 25 '24 17:07 h3xds1nz

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.

Alexgoon avatar Aug 08 '24 05:08 Alexgoon

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

h3xds1nz avatar Aug 08 '24 05:08 h3xds1nz

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 avatar Sep 23 '24 11:09 Alexgoon

@Alexgoon - We will be including this PR for upcoming test cycles, and it will go in for .NET 10.

pchaurasia14 avatar Sep 23 '24 12:09 pchaurasia14

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

Alexgoon avatar Sep 30 '24 15:09 Alexgoon

@siagupta0202 Any news on this one?

h3xds1nz avatar Mar 03 '25 09:03 h3xds1nz

@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 avatar Mar 06 '25 06:03 siagupta0202

@siagupta0202 Rebased so we can get this done finally.

h3xds1nz avatar Mar 31 '25 09:03 h3xds1nz

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.

codecov[bot] avatar Mar 31 '25 09:03 codecov[bot]

LGTM, @h3xds1nz can you resolve the merge conflicts?

siagupta0202 avatar Apr 03 '25 08:04 siagupta0202

@siagupta0202 Done, sorry for the delay :)

h3xds1nz avatar Apr 03 '25 12:04 h3xds1nz

@h3xds1nz Thank you so much for your contribution!

siagupta0202 avatar Apr 04 '25 09:04 siagupta0202

@siagupta0202 So happy to see this one in :) Thanks!

h3xds1nz avatar Apr 04 '25 09:04 h3xds1nz