Affects Version/s: None
Fix Version/s: None
Currently the Clojure compiler makes multiple redundant calls to Method.getMethod(...) while emitting code, e.g.
gen.invokeStatic(Type.getType(Long.class), Method.getMethod("Long valueOf(long)"));
It seems to be the case that that:
a) These getMethod calls are effectively returning equivalent, immutable constant values
b) getMethod is moderately expensive (performs string analysis and quite a few object allocations)
c) These calls are very common during compilation of typical Clojure code
The proposed enhancement is to replace all of these getMethod calls with constant static values. This should improve compilation performance noticeably with no effect on behaviour.