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

Class 65k tests is disproportionally slow #3516

Closed
nohwnd opened this issue Mar 24, 2022 · 4 comments
Closed

Class 65k tests is disproportionally slow #3516

nohwnd opened this issue Mar 24, 2022 · 4 comments
Assignees

Comments

@nohwnd
Copy link
Member

nohwnd commented Mar 24, 2022

Creating a class with 65k tests (limit of max methods per class is just a smidge above that), results in the run being really slow.

Class with 10k empty tests runs in about 4 seconds. (Even if there are 9999 filters).

Class with 65k tests run over 4 minutes.

This does not seem to be related to filtering, it takes this long even without any filters applied.

I did not check if this happens if the total amount of tests are over a given limit. Single class with more than 10k tests is unlikely, but run with 20k tests in total is not as unlikely.

AB#1865125

@nohwnd
Copy link
Member Author

nohwnd commented Aug 3, 2023

Added to sprint for quick test if someone can see what is going on. We mostly should optimize for test runs of 1-100 tests, and discovery of 10-1000 tests, so this is quite a bit out of that scope, but still might be worth it if obvious problem is found.

@nohwnd nohwnd self-assigned this Jul 8, 2024
@nohwnd nohwnd closed this as completed Jul 9, 2024
@nohwnd nohwnd reopened this Jul 9, 2024
@nohwnd nohwnd removed the enhancement label Jul 9, 2024
@nohwnd
Copy link
Member Author

nohwnd commented Jul 11, 2024

After the perf changes in mstest this is still not linear, but it improved a lot.

image

@nohwnd
Copy link
Member Author

nohwnd commented Jul 11, 2024

The slowness seems to be caused by the lookup of method in a huge class being slow:

image
image

When we spread the tests into classes with 20 tests per class, or even 1000 tests per class the perf is normal again. So imho this is just a denegerate case.

image

@nohwnd
Copy link
Member Author

nohwnd commented Jul 11, 2024

Measures between the perf before using reflection cache for discovery and run, and after (between 3.3 and 3.5):

image

@nohwnd nohwnd closed this as completed Jul 11, 2024
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

1 participant