Fork me on GitHub
#graalvm
<
2020-12-09
>
borkdude18:12:05

@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

zane18:12:56

Oh, good to know!

zane19:12:22

That’s a bummer.

borkdude19:12:30

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

zane19:12:34

Yeah. Still might be worth it for some applications.

zane19:12:02

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

jeroenvandijk22:12:30

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

borkdude22:12:52

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

👍 3
mafcocinco22:12:27

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!

borkdude22:12:47

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

borkdude22:12:12

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

mafcocinco22:12:38

thanks! such great information.

borkdude22:12:39

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