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

Improve performance of ID generation #2762

Open
Evangelink opened this issue Apr 25, 2024 · 5 comments · May be fixed by microsoft/vstest#5081
Open

Improve performance of ID generation #2762

Evangelink opened this issue Apr 25, 2024 · 5 comments · May be fixed by microsoft/vstest#5081
Assignees
Milestone

Comments

@Evangelink
Copy link
Member

Evangelink commented Apr 25, 2024

We have noticed that the ID generation is having an heavy impact on performances of MSTest discovery/run, let's investigate what we can improve and if there are some quick wins let's do them directly.

AB#2050310

@nohwnd
Copy link
Member

nohwnd commented Apr 26, 2024

There are 2 instanced of where IDs are generated for each test, which in total take 20% of execution, plus other interactions with ObjectModel (such as adding traits to traits collection).

I am not sure where the bottleneck of the id generation is, but it does ask reflection for information that we already have (e.g. information about assembly), and that we could pass in. It also does not seem to handle strings in an efficient way.

All the hotspots here are easy to measure by running a test project under PerfView and specifying --list-tests. See the changes here to add stopwatch around the discovery to not take writing to console into account.

https://github.com/nohwnd/testfx/tree/discovery-optimize-and-break

@nohwnd nohwnd self-assigned this May 2, 2024
@nohwnd nohwnd added the sprint label May 2, 2024
@testplatform-bot
Copy link
Contributor

✅ Successfully linked to Azure Boards work item(s):

@SimonCropp
Copy link
Contributor

@Evangelink can u point me to the code that does the id generation?

@Evangelink
Copy link
Member Author

@nohwnd I created the ticket from your feedback but didn't look at it. From the branch you have linked, I see mainly changes to reflection helpers nothing around ID generation. Can you answer @SimonCropp here?

@nohwnd nohwnd linked a pull request Jun 3, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants