4 ms·
Java 7 has introduced a very specific API (java.lang.invoke) to be able to inline reflection calls. So lookups are quite slow, but invocations are fully inline
by __old_dude__ 10y ago
Java 7 has introduced a very specific API (java.lang.invoke) to be able to inline reflection calls.
So lookups are quite slow, but invocations are fully inlined.
java.lang.invoke API is fast to the point that for doing faster string concatenation in Java 9, Aleksey Shipilev has used this API instead of introducing a new opcode in the JVM [1].
[1] https://youtu.be/wIyeOaitmWM?list=PL2ekzZZrxVUmBXtrwS7pLabUu8v-FCE8O&t=2278 https://youtu.be/wIyeOaitmWM?list=PL2ekzZZrxVUmBXtrwS7pLabUu...