z4kn4fein / stashbox

A lightweight, fast, and portable dependency injection framework for .NET-based solutions.

Home Page:https://z4kn4fein.github.io/stashbox

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bad performance

reservoir-dogs opened this issue · comments

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
}

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

Hello,

When can you deliver the fix ?

Hi,

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

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

I tested it and it works!
Thanks