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?
To me, that implies that the method argument should be required to implement a particular interface or inherit from a particular class. Keep in mind, the interface could be a marker like RandomAccess. I realize changing your API may not be an option.