You'll need to cache this stuff yourself.  I really recommend avoiding
reflection though for any performance critical things -- even if there is no
time required for the class/methods lookup, you will still tend to spam a
lot of temporary objects.  If you are going to use reflection, plan to spend
a good amount of time optimizing that code to get it to perform well.

On Sat, Mar 12, 2011 at 12:13 PM, ko5tik <[email protected]> wrote:

> Hi all,
>
> Doing profiling I discovered that Class.getMethods() is taking a lot
> of time, and results are not cached internally - from J2EE world I'm
> used that such caching is available, and must be switched off
> explicitly.  Is there reason for this? (I'm sure there is a good one,
> but can not find
> it) What is best strategy to overcome this problem?
> As I develop lightweight JSON databinding framework,  I'm doing a lot
> of reflection. My current solution is to cache acquired methods array
> in the map, but maybe ther eis better solution I overlook?
>
> regards,
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> 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/android-developers?hl=en
>



-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
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/android-developers?hl=en

Reply via email to