Skip to content

Performance improvement for Mocking many large classes - #1530

Merged
kzu merged 1 commit into
devlooped:mainfrom
crinksdr:main
Feb 18, 2025
Merged

kzu merged 1 commit into
devlooped:mainfrom
crinksdr:main

Conversation

@crinksdr

Copy link
Copy Markdown
Contributor

When mocking many large classes across multiple assemblies causes a huge performance slow down as more classes get mocked. The AbstractTypeEmitter::CreateType in Castle.Core gets slower for each method on each class over time. Seeing up to 10 times slower as more and more classes get mocked.
By having a ProxyGenerator for each namespace it means less data in each ProxyGenerator and faster loading.
In my test case the large classes each had ~400 methods and there were 100s of these classes all being mocked across all the tests. Test time went from 6 min down to 30 seconds with this change.

@CLAassistant

CLAassistant commented Feb 13, 2025 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@crinksdr crinksdr changed the title Performance improvement for Mocking may large classes Performance improvement for Mocking many large classes Feb 13, 2025
@kzu
kzu enabled auto-merge (rebase) February 18, 2025 05:44
@kzu
kzu merged commit 2119f37 into devlooped:main Feb 18, 2025
@devlooped devlooped locked and limited conversation to collaborators Mar 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants