Sam, while I don't think I'm quite yet qualified to patch the library, I do 
have a suggestion and pointer.  The slow performance is because Android is 
terribly slow at annotation reflection.  OrmLite, an ORM that supports 
Android nicely, improved things using a technique described in this Stack 
Overflow post <http://stackoverflow.com/q/7417426/403455>:

"An interesting reflection performance improvement was given to me. We are 
now using reflection to peek inside the AnnotationFactory class to read the 
list of fields directly. This makes the reflection class 20 *times* faster 
for us since it bypasses the invoke which is using the method.equals()call. It 
is not a generic solution but here's the Java code from ORMLite 
SVN 
repository<http://ormlite.svn.sourceforge.net/viewvc/ormlite/ormlite-android/trunk/src/main/java/com/j256/ormlite/android/DatabaseTableConfigUtil.java?view=markup>
."



On Friday, May 18, 2012 9:16:14 AM UTC-5, Sam Berlin wrote:
>
> Creation of the factories themselves aren't particularly optimized, 
> calling factory.create(..) to create your assisted objects is what's 
> optimized.  Creation of factories should only happen once (at startup), so 
> the cost isn't as crucial.  If you have suggestions for optimizing the 
> code, though, please file a bug with a patch!
>
>  sam
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-guice/-/BpnmHtsS1x0J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to