z4kn4fein / stashbox

A lightweight, fast, and portable dependency injection framework for .NET-based solutions.
https://z4kn4fein.github.io/stashbox
MIT License
141 stars 10 forks source link

Bad performance #79

Closed reservoir-dogs closed 4 years ago

reservoir-dogs commented 4 years ago

In AspNet Core 3.1.2, I am requesting the resolution of a dependency list, but the longer the list, more the performance degrades exponentially.

https://github.com/reservoir-dogs/WebApplicationStashboxPerformance In this project, you can vary the number of dependencies in the ClassGenerator.tt file

For 10, the result is : { "elapsed": { "totalSeconds": 0.0264865 }, "count": 9 }

For 100, the result is : { "elapsed": { "totalSeconds": 0.9636601 }, "count": 99 }

For 200, the result is : { "elapsed": { "totalSeconds": 4.2962879 }, "count": 199 }

Without StashBox and 1000 instances, the result is : { "elapsed": { "totalSeconds": 0.0807929 }, "count": 999 }

z4kn4fein commented 4 years ago

Hey, thanks for reporting this! I found the root cause of this behavior, I'm working on the fix now.

reservoir-dogs commented 4 years ago

Hello,

When can you deliver the fix ?

z4kn4fein commented 4 years ago

Hi,

I'm planning to finish the preparation for the release this week, probably the end of this week. Thanks for your patience!

z4kn4fein commented 4 years ago

Hey, Sorry for the long delay, just wanted to notify you that I released the version which contains the fix for this issue.

reservoir-dogs commented 4 years ago

I tested it and it works! Thanks