Skip to content
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

test run duration degredation when upgrading from 8.8.74 to 8.8.165? #227

Closed
kimpenhaus opened this issue Jul 23, 2024 · 11 comments
Closed

Comments

@kimpenhaus
Copy link

hey @SteveGilham

I hope this doesn't come across as unqualified, but I wanted to share my observations and would like to get your feedback.

Today, Renovate gave us a PR for the version upgrade from 8.8.74 to 8.8.165. When running our PR pipeline, I noticed that the test duration has increased significantly.

Normal run duration of the unit-test step was around 4~6 minutes:

grafik

After upgrading to the latest version, this step increased to over 13 minutes:

grafik

I re-ran the whole pipeline to ensure it wasn't an issue caused by machine load or something similar - the result was nearly the same:

grafik

I'm not sure what additional information I can provide, but I would appreciate any feedback and am happy to provide it.

Thanks,
Marcus

@SteveGilham
Copy link
Owner

Thank you for the report, unwelcome though the news is.

Of the two significant changes in this release, the recorder rewrite would be the more pervasive, and the more likely culprit. I had hoped it would make little impact, and perhaps more performant by eschewing the extra allocations required with immutable data structures - the AltCover self-tests having shown no noticeable change.

One easy way to find out, if you could be so good as to oblige - here is a build taken from the point immediately before the recorder rewrite began, but after the Cobertura fix. If you could give this a try, that should give a definitive answer as to where the problem lies

nupkgs.zip

If it is the recorder, then I can scrap that change, put out a new release now, and then get an alternative strategy ready for net9.0 in November.

@kimpenhaus
Copy link
Author

kimpenhaus commented Jul 24, 2024

Good Morning @SteveGilham,

I needed to switch from the azure pipeline to my local machine to run the tests with the version you gave me.

I tried to leave the machine doing its stuff with no interaction - so that the results are more or less comparable.

I then changed the version to:

  • 8.8.74
  • 8.8.90-pre-gdeef884004
  • 8.8.165

I did alsways a dotnet restore and a dotnet build -c Release --force

and then started with the command:

dotnet test Solution.sln --logger trx --results-directory ./_temp --nologo --no-build --configuration Release /p:CopyLocalLockFileAssemblies=true /p:AltCover=true /p:AltCoverFailFast=true /p:AltCoverAssemblyFilter='^(?!Some\.Namespace).*$|^(Some\.Namespace.*?\.Test.*)$' /p:AltCoverAttributeFilter=ExcludeFromCodeCoverage /p:AltCoverCobertura=coverage.cobertura.xml

the results were as follows:

grafik grafik grafik

As you can see there - unfortunately - no difference between 8.8.90-pre-gdeef884004 and 8.8.165. So it might be the cobertura fix kickin in - not sure if that is optimizable at all or the state we have to live with

Hope that helps - if you need further information or any other testings - just let me know. I am happy to help with that.

m.

@SteveGilham
Copy link
Owner

Thank you for that. Not the result I had hoped for.

Could you confirm that you are actually opting to generate Cobertura output (via /p:AltCoverCobertura=... or equivalent), as that change would only affect the reformatting part of the process. The only other differences will be in the versions of third-party libraries used, which will be a tedious thing to track down.

@kimpenhaus
Copy link
Author

hope I understood you correctly as I am not a native speaker (guess you figured this already 😄)

yes we are having /p:AltCoverCobertura=coverage.cobertura.xml as parameter (see the long dotnet test Solution.sln (at the end))

@SteveGilham
Copy link
Owner

My apologies, I had missed the command line, having simply focused on the elapsed time.

Now I know where to look. Thank you!

@kimpenhaus
Copy link
Author

kimpenhaus commented Jul 25, 2024

Good morning @SteveGilham,

today I gave it another shot with additionally setting the /p:AltCoverSingle=true flag - I thought I try to see if that makes any difference - unfortunately it does not

grafik

I thought you might be interested in that as well - if there are other things you might think might improve perf or is worth to try just let me know.

👋🏼

@SteveGilham
Copy link
Owner

SteveGilham commented Jul 25, 2024 via email

@SteveGilham
Copy link
Owner

A proper soak test showed that the bottleneck was indeed where I though it would be, and also verified that there were no more hotspots after the fix I made, which brought performance back to where it had been. Here's an interim build for your use -

nupkgs.zip

@kimpenhaus
Copy link
Author

kimpenhaus commented Jul 26, 2024

Oh that is awesome 🙏 over the weekend I am off with the family but as soon as i will be back home again, I'll run some tests. Thanks for fixing it that fast!

@SteveGilham
Copy link
Owner

It's also in new release v8.8.173

@kimpenhaus
Copy link
Author

hey @SteveGilham,

I can confirm that the test run speed is as good as it was before :) thanks for fixing it that quickly and for allt he time you spent in this project!

m.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants