在Android吉斯性能吉斯、性能、Android

2023-09-06 01:41:52 作者:指尖花落、已成殇

作为一个Java开发者,我已经习惯有依赖注入的应用程序。对于Android虽然,我特别警惕的性能。什么是在一个Android应用程序使用吉斯对性能的影响?我认为有一些开销,但它显著不够,我应该避免使用吉斯?

As a Java developer I've become accustomed to having dependency injection available in applications. For Android though, I am especially wary of performance. What are the performance implications for using Guice in an Android app? I assume there is some overhead, but is it significant enough that I should avoid using Guice?

我利用它很可能只是注入了几个共享对象为各种活动。

My use of it would likely just be to inject a few shared objects into various activities.

推荐答案

由于第3版,吉斯缓存反射对象,以提高性能。有至少一个bug被纠正的反对的Dalvik做出注解查找更快,但目前的表现是可行的。

As of version 3, Guice caches reflective objects to improve performance. There's at least one bug out against dalvik to make annotation lookups faster, but the current performance is workable.

 
精彩推荐
图片推荐