Fork me on GitHub

@mikerod, is it generally good practise to type-hint for perfomance reasons? Are you guys recommending it? or, why should I not do it?


I suggest reading . A very short explanation is that the JVM can compile something like (.someMethod x) to run faster if the type of x is known at compile time. In absolute terms, though, even without type hints the calls are still fast. In our codebase we make a point of avoiding reflection since 1. We work at a very large scale that makes such bottlenecks matter. 2. It is easier to avoid reflection entirely than to have to release our code again when it turns out there is a major perf problem. What you should do depends on your use-case and the attendant tradeoffs; some people don’t (and shouldn’t for their use-cases) care about reflection