danielpalme / IocPerformance

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

Make aspnet core benchmark more realistic #115

Closed Barsonax closed 5 years ago

Barsonax commented 5 years ago

Currently the aspnet core benchmark resolves just a single scoped instances 3 times per scope. This makes it very easy to design a container that scores high on this specific workload. All one needs to do is use a datastructure thats fast on adding items and fast on returning that item if there is only 1 item. A datastructure such as a singlylinked list or even a simple field could be used for this.

Containers using such a datastructure in this case may seem to be the fastest however given the fact that such a approach does not scale very well it may give the wrong impression.

Just to give you a idea its pretty trivial to make Singularity perform 2x faster on this benchmark by doing this.

I think it would be better if:

danielpalme commented 5 years ago

You are right, it would be possible to create an optimized container. But that's always possible in a fixed scenario.

If you like you can change that. I won't invest any time in this benchmark any more (apart from updating the containers from time to time).