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

Performance Issues After Version 4.12.0 #1269

Closed
asherjvitek opened this issue Jun 29, 2022 · 4 comments
Closed

Performance Issues After Version 4.12.0 #1269

asherjvitek opened this issue Jun 29, 2022 · 4 comments

Comments

@asherjvitek
Copy link

Recently we updated our version of moq from 4.7.99 to 4.17.2 in the Solution we use which has around 12,000 unit tests. When we did this the Test run times jumped from around 3+ minutes to 12+ minutes. Once this was noticed we did some benchmarking on a subset of 54 of those unit test and found the following performance differences.

MOQ Version Time
4.7.99 2.7sec
4.8.0 1.1sec
4.9.0 1.1sec
4.10.0 1.1sec
4.11.0 979ms
4.12.0 959ms
4.13.0 10.3sec
4.15.1 10.5sec
4.17.2 10.5sec

It would appear that after at version 4.13.0 there is a large slow down in the time it takes to run our unit tests.

I found this issue and the comment in the last bullet point seems to be exactly what I am seeing but I feel like a performance hit like this seems a little too large.

Is this performance hit to be expected in newer versions?

If you need a sample of the tests I would need to extract and change the code as it is proprietary to the company I work for but is something I should be able to do if it is necessary.

Please let me know and thank you.

@stakx
Copy link
Contributor

stakx commented Jun 29, 2022

If you need a sample of the tests I would need to extract and change the code

Yes, if you want someone looking into this, repro code will be required. Otherwise there isn't much that can be done.

@stakx
Copy link
Contributor

stakx commented Jul 24, 2022

@asherjvitek, any chance that you could provide a test case that I could use to re-run those runtime measurements / reproduce the performance degradation starting in version 4.13.0?

Otherwise I'm going to close this issue in about two weeks' time.

@asherjvitek
Copy link
Author

asherjvitek commented Jul 24, 2022 via email

@stakx
Copy link
Contributor

stakx commented Jul 24, 2022

Thanks for your reply. OK, I'll close this for the time being, feel free to add a test case / repro code anytime and we can reopen this issue.

mocking a large COM Interop object

If you're mocking a co-class, and it's large (as in: it has many virtual methods), that might be the problem. If you're mocking COM interfaces, I'm surprised that updating to the latest Moq version doesn't bring a huge performance speedup as there has been a significant optimization for interface proxies in DynamicProxy recently.

Looking forward to the test code... but take all the time you need.

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

No branches or pull requests

2 participants