graalvm

Discuss GraalVM related topics. Use clojure 1.10.2 or newer for all new projects. Contribute to https://github.com/clj-easy/graal-docs and https://github.com/BrunoBonacci/graalvm-clojure. GraalVM slack: https://www.graalvm.org/slack-invitation/.
borkdude 2020-12-09T18:57:05.193700Z

@zane I have tried upx and found it to have a pretty negative impact on startup time.

$ time ./bb '(+ 1 2 3)'
6
./bb '(+ 1 2 3)'   0.19s  user 0.03s system 98% cpu 0.229 total
Normally this is 20ms or so on macos, and even 4-5ms on linux

zane 2020-12-09T18:59:56.193800Z

Oh, good to know!

zane 2020-12-09T19:00:22.194Z

That’s a bummer.

borkdude 2020-12-09T19:04:30.194200Z

Well if 250ms is still acceptable and more important than size, than there's a trade-off

zane 2020-12-09T19:05:34.194400Z

Yeah. Still might be worth it for some applications.

zane 2020-12-09T19:06:02.194600Z

Ah, the article does cite a ~250ms slowdown, so that’s consistent with your experience.

2020-12-09T22:06:30.194800Z

For the record, how much size was saved here? Just curious.

borkdude 2020-12-09T22:07:52.195Z

about 70m -> 20m. same as zipped basically

1👍
mafcocinco 2020-12-09T22:50:27.199300Z

I am new to GraalVM and I’m trying to get a native image built from a Clojure project (we have need for a CLI tool at my job and I would prefer to not have to introduce a new language just for it). I was able to install GraalVM (`graalvm-ce-java8-20.3.0`) including the native-image utility. I was following https://www.astrecipes.net/blog/2018/07/20/cmd-line-apps-with-clojure-and-graalvm/ but ran into a road block. The native-image utility runs successfully and produces an executable image. however, when I attempt to run the image, I get a stack dump indicating that the clojure.core library is not found. I have found a few references to this in various places with various prescriptions for fixing it. None of them have worked for me. I’m using clojure 1.10.0 if that matters. Any assistance would be greatly appreciated. Thanks!

borkdude 2020-12-09T22:58:47.199600Z

@mafcocinco I recommend following the hello world examples here: https://github.com/lread/clj-graal-docs

borkdude 2020-12-09T22:59:12.200300Z

Also, for graalvm please use 1.10.2-alpha4, as suggested in the topic of this channel

mafcocinco 2020-12-09T22:59:38.200900Z

thanks! such great information.

borkdude 2020-12-09T22:59:39.201Z

It's likely that your classpath for the graalvm project isn't set correctly.