On 01/09/2012 09:28 AM, Julien Ponge wrote:
Hi,
Is there a performance penalty in using a method handle obtained using
unreflect() vs findVirtual()?
This is not clear from the docs.
In practice, there is no perf difference when you call the resulting
method handle.
The only difference is that findVirtual() may be faster than
getMethod/getDeclaredMethod+unreflect
because you send the return type of the method to findVirtual() which
avoid to crawle
all methods of the vtable (or of a side map) to find the one requested.
The reflection API also requires to return the method with the most
specific return type
when you have several methods with the same parameter types.
Cheers
--
Julien Ponge
http://julien.ponge.info/
cheers,
Rémi
--
You received this message because you are subscribed to the Google Groups "JVM
Languages" group.
To post to this group, send email to jvm-languages@googlegroups.com.
To unsubscribe from this group, send email to
jvm-languages+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/jvm-languages?hl=en.