Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

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.

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1779 (reported by mikera)
...