Fork me on GitHub

hmm… looking at it now I think I know what’s going on. Sorry for the noise


hinting identity with ^String solves the issue

Alex Miller (Clojure team)13:12:43

Btw in 1.8 there is now clojure.string/starts-with? instead

Alex Miller (Clojure team)14:12:03

In case anyone here is interested in some early tire-kicking, Rich just pushed a change to master to avoid interning unused constants in the static initializer. This is particularly useful for direct linking, but also possibly impacts other compiled classes as well. This seems to have good effects on both class size and startup time (due to reducing class load time).

Alex Miller (Clojure team)14:12:21

we are still doing some testing on things before cutting an RC, but if anyone is interested, those changes are in the latest 1.8.0-master-SNAPSHOT release. see for info on how to use a snapshot version from your project (you need to add an additional maven repo to find it)


I did some testing and can confirm it does remove all the unused keywords from keyword lookup sites and the unused boxed numbers in prim functions


it might have some weird side effects (a la CLJ-130) but it's probably a very remote possibility


I just ran a basic startup test, seeing 15%-20% improvement


IME the bloated constant pool clojure was emitting accounted for a significant chunk of startup time & classfile size


metadata now will probably be responsable for the most bytecode in static initializer


i.e. [^{:foo 1} [1] ^{:foo 2} [2]] interns the foo keyword twice rather than once and store it in the local table


I think that could be solved by using a metadata table similar to the constant table, that only lives in the local table of <clinit> but I'm not sure how hard it would be to implement


@alexmiller: I haven't kicked the tires as hard as bronsa, or with any significant code yet, but I see that AOT'd "Hello world" takes 13% less elapsed time, 9% less user+sys time, and 5% less max resident memory with the latest commit, as compared to before that commit.

Alex Miller (Clojure team)21:12:45

yeah, that's pretty consistent with what I'm seeing