danielpalme / IocPerformance

Performance comparison of .NET IoC containers
https://danielpalme.github.io/IocPerformance
Apache License 2.0
874 stars 157 forks source link

Add VS-Mef #120

Closed znakeeye closed 5 years ago

znakeeye commented 5 years ago

Should be fairly easy to add?

https://github.com/Microsoft/vs-mef

danielpalme commented 5 years ago

Would you like to send a PR?

jzabroski commented 5 years ago

Almost seems like GitHub could use a neutral ChatBot to respond to "Hey, I think this is easy to do..." with "Would you like to send a PR (for that easy to add feature)?"

Barsonax commented 5 years ago

Why not implement a bot that implements the feature for you then? 😉

znakeeye commented 5 years ago

In most bug/feature tracking systems, you first report an issue. The implementation is usually added after a more detailed analysis.

Yes, I would like to send a PR at some point. If I get hit by a car before doing so, it's certainly good to have an issue ID to refer to.

BalintPogatsa commented 5 years ago

I've done some tests with VS-Mef. The only performance indicators which were better than Mef2 (2-3 times faster):

In every other benchmark Mef2 produced way better result (40 times)

I'm just experimenting with VS-Mef so there is a chance that I've done something in a suboptimal way.

The problem with adding this PR is that VS-Mef doesn't support generics and it has a build step which fails on ImportGeneric. If I don't use their build step, the only advantage over Mef2 disappears as well.

image

image

weltkante commented 5 years ago

Maybe you can share your implementation instead of just numbers and saying "you aren't sure if you done it right" ?

AArnott commented 5 years ago

I'm giving it a go.

znakeeye commented 5 years ago

It would also be of interest to see how vs-mef performs when loading from a serialized graph. It's certainly faster than standard MEF.

@weltkante, I don't think he can share the implementation until the next version of vs-mef. Mainly due to this PR.

AArnott commented 5 years ago

It's true, right now I'm consuming that PR to make this easier, but IMO the API for this perf test should provide generic type arguments so that all libraries work since generic type -> Type is much easier than Type -> generic type.

danielpalme commented 5 years ago

I just removed DryIocZero and Cauldron (both are using Fody). Build should now work faster and reliably.

dadhi commented 5 years ago

DryIocZero does not use Fody, but it's fine.

danielpalme commented 5 years ago

@dadhi Sorry, will add it again tomorrow.

BalintPogatsa commented 5 years ago

I've also uploaded my sources where I'm using the latest AppHost package: https://github.com/BalintPogatsa/IocPerformance

I've excluded all other adapters besides Mef2 and VS Mef for now, to make the comparison fast.