-
Notifications
You must be signed in to change notification settings - Fork 86
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 compared to MEF 2 #152
Comments
It doesn't look like you linked to a repository containing a VS MEF benchmark, I only found danielpalme/IocPerformance#120. Maybe you can share your implementation instead of just showing some numbers? |
I will when I find the time. Do you also have some performance comparison that I could check? |
No I don't have measurements, but I'm using VS MEF in a few projects and could check if there's anything obviously wrong in the benchmark. It sounds surprising that VS MEF should be that much slower considering that the whole dependency graph is precalculated. |
VS MEF was merged to the main repository of this benchmark: If you want to take a look at the comparison using the AppHost package (running the console app will give the result only for Mef 2 and VS Mef): |
I just ported a super large
I suppose the |
Could the performance discrepancies have anything to do with jitting? I.e. MEF2 is already jitted when the benchmark is performed, whereas vs-mef is not. |
That might explain a startup cost, but not a throughput perf difference. Also: vs-mef is thread-safe and MEFv1 and MEFv2 have known thread-safety bugs. Being thread-safe in a MEF engine requires very careful planning, and it's quite possible that in being truly thread-safe, we have a state machine system that is fundamentally slower than the non-thread-safe one that MEFv2 uses. |
Not to mention that latest release requires reflection to call |
16.3.4-alpha was just pushed to nuget.org. It should be available in less than an hour and includes the new API. |
@AArnott, I just realized that verifying the assembly timestamps is dead slow. So I need to change my conclusion. |
@AArnott, did you drop support for
|
Yes. 16.3 targets net472 and netstandard2.0. |
There is a comparison library for several IoC implementations. Comparing VS MEF to MEF 2 shows that VS MEF is only better in startup performance, but significantly slower in other benchmarks:
https://github.com/danielpalme/IocPerformance
Compared versions (this is the nuget package version - the screenshot displays the assembly version):
Do you think it is still justifiable in some cases to use VS MEF over MEF 2? Or could be there a conceptual problem why these benchmark values are worse? Do you maybe have other benchmarks that shows a different picture?
The text was updated successfully, but these errors were encountered: