-
Notifications
You must be signed in to change notification settings - Fork 314
Benchmark and profile the ServiceProvider #124
Comments
Back in 2010 I published an log post Introduction to Munq IOC Container for ASP.NET. As part of this article, I compared the performance of the current 'standard' DI Containers. Mine was the fastest, not surprisingly as that was its primary design goal. However, I updated the tests the other night and added the
You can find the source for the tests at https://github.com/matthewDDennis/Performance. I don't think you have to worry about performance too much with this system. It is fast enough that rest of the application's code execution time will be orders of magnitude larger than the DI code. You might also like to see the article Munq is for web, Unity is for Enterprise by Omar AL Zabir. |
You also might want to check out this benchmark. |
Closing because we have already done other investigations in this space, so this bug isn't needed. |
As part of PR #121, we made some changes to improve the performance of service resolution from ServiceProvider.
However, as of yet, we have not specifically benchmarked the performance of ServiceProvider. We should create some microbenchmarks for ServiceProvider so we can measure the performance impact of the changes we make to ServiceProvider and profile the ServiceProvider code. Microbenchmarks can be a useful tool even though they do not reflect real-world usage patterns.
@GrabYourPitchforks has suggested that it isn't necessary to use compiled expression trees to replace code that does not use reflection. If the performance impact is negligible, it might be better to use expression trees sparingly just for things like constructor invocation to make the code simpler and easier to debug. Once we have benchmarks, we can measure what the performance difference of compiling more or less. This should help us decide which approach we should take.
The text was updated successfully, but these errors were encountered: