setAccessible helps method reflection.

This commit is contained in:
NathanSweet 2014-03-06 20:02:27 +01:00
parent 537351e3f7
commit 1472e95148

View File

@ -16,6 +16,7 @@ public class MethodAccessBenchmark extends Benchmark {
int index = access.getIndex("getName");
Method method = SomeClass.class.getMethod("getName");
// method.setAccessible(true); // Improves reflection a bit.
for (int i = 0; i < 100; i++) {
for (int ii = 0; ii < count; ii++)