Hi <@U1ZQ36CJD>, I'm the author of Kodein. No such...
# kodein
Hi @spierce7, I'm the author of Kodein. No such benchmark has been conducted for Kodein and if you do such a thing, I'd be happy if you could post the results. Here what I can tell you : - Kodein does no heavy duty at startup. No class scanning, at all. In fact, Kodein was developp with the idea to avoid reflection. When you startup Kodein, all dependencies declarations are stored in a map. - You may have startup performance issue if you declare some eager singletons. Those are singletons bindings that will be constructed when Kodein starts up. The performance issue would be then located in the bound singleton constructor, outside of Kodein's reach 😉 - Most of Kodein's duties are performed at retrieval. So, if you do benchmark, you'll find that retrieval will be slightly slower than Dagger which does every check at compile time. In Kodein, recursivity checks are performed at retrieval. I believe the difference in performance to be very small, though. - Also, failures are slower, because Kodein do use reflection when it does not find the right binding to probe for another correct binding. Since failures generate exceptions, I figured it would be OK. (Of course, hits are cached to prevent re-using reflection). In the end, if you do benchmark, I think you'll find Dagger to be slightly better. Dagger is a pain to use in Kotlin though, so I don't believe there's a goto answer as to which DI library is better for your use case. If you do benchmark, please post the result as I believe they would be very informative 😉