-
-
Notifications
You must be signed in to change notification settings - Fork 801
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
Slower performance after upgrading from 4.2.1510 to 4.14.7 #1083
Comments
There's quite frankly nothing we can do to help you without some code we can run and benchmark, so I am going to have to close this issue... sorry. A few remarks though:
|
P.S. it's good you already found the Castle.Core issue. My advice there re: proxying huge types is equally valid for Moq. Also, if you do manage to prepare a test project, please post it here and we'll reopen this issue! |
Thank you for the great replies. While not a direct lead on the performance regression itself, we have had very good experience in our own code base (which is really heavy on Emit usage) by changing from System.Emit to Mono.Cecil. If you are interested in accepting an alternative backend for Moq, how do you suggest we go about implementing the logic for switching between the two backends for the end user? |
@Znurre, the default proxy factory should remain DynamicProxy, however adding the ability to opt-in to using a different one is a possibility. Perhaps the easiest place to add this is At some point in the past I have wanted to expose Now, while the above may be the easiest way to allow you to swap out DynamicProxy, it isn't necessarily the best. It might actually be neater to expose a This also causes a large amount of necessary refactoring work because you have to query for these instance properties instead of a well-known global static property in a variety of places. Which is why I haven't done it yet. No point in complicating code for a feature that only very few users are going to use. In my personal opinion, this doesn't have super-high priority... not with Moq v5 (with its superior architecture & approqch to code generation) just around the corner. But if you'd like to work on it anyway, I guess it would be good to do this in stages, i.e.:
|
Thank you so much for the pointers @stakx. We will most likely not be able to upgrade to Moq v5 anytime soon due to legacy code base, so we will make an attempt at creating and upstreaming this alternative |
I'm trying to troubleshoot why the test duration has increased by several seconds on a lot of tests (which amounts to double-digit minutes total).
Synthetic tests show that the newer Moq version is a lot faster with both
new Mock
andMock.Of
. But real testcases are significantly slower.I think the issue is somewhat related to this Castle issue. As we've also updated Castle from 4.3.3 to 4.4.1, I'm not sure if the issue is with Castle or Moq.
Are there any known performance issues where mocked interfaces (and classes) with A LOT of properties and methods with multiple layers of inheritance with even more properties have become slower in newer updates?
I'm sorry I can't provide a repro as it's production code and I've yet to successfully reproduce it myself in a contained unit.
The text was updated successfully, but these errors were encountered: