What are the suggested alternatives for Class<T>.isAssignableFrom(Class<?> cls)?

Posted by Wing C. Chen on Stack Overflow See other posts from Stack Overflow or by Wing C. Chen
Published on 2010-03-16T04:47:59Z Indexed on 2010/03/16 5:46 UTC
Read the original article Hit count: 199

Filed under:
|
|

Currently I am doing the profiling to a piece of code. During the profiling, I discovered that this very method call,

Class<T>.isAssignableFrom(Class<?> cls)

takes up to quite amount of the entire time.

Because this is a method from reflection, it takes a lot of time compared to normal keywords or method calls. I am wondering if there are some good alternatives for this method calls?

© Stack Overflow or respective owner

Related posts about java

Related posts about reflection