How slow is Java reflection?
We always hear “reflection is slow, don’t use reflection in Java”. Just today there was an article on Reddit’s /r/java purportedly showing that reflection is ~10x slower than calling the getters directly.
Fortunately the author provided source code. Unfortunately he committed a couple of mistakes:
- He was ...