Fork me on GitHub
#clojure-dev
<
2015-12-11
>
jonas08:12:19

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

jonas08:12:21

hinting identity with ^String solves the issue

alexmiller13:12:43

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

alexmiller14: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).

alexmiller14: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 http://dev.clojure.org/display/community/Maven+Settings+and+Repositories for info on how to use a snapshot version from your project (you need to add an additional maven repo to find it)

bronsa14:12:02

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

bronsa14:12:41

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

ghadi15:12:58

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

bronsa15:12:22

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

bronsa15:12:52

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

bronsa15:12:54

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

bronsa15:12:18

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

andy.fingerhut21:12:11

@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.

alexmiller21:12:45

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