niklas-heer / speed-comparison

A repo which compares the speed of different programming languages.
https://niklas-heer.github.io/speed-comparison
MIT License
475 stars 76 forks source link

use staticcompiler for julia instead of packagecompiler.jl #38

Closed Moelf closed 1 year ago

Moelf commented 1 year ago

this compiles in a few seconds and runs like C (i.e. no start-up overhead):

/t/s/src (master)> hyperfine ./mainjl
Benchmark 1: ./mainjl
  Time (mean ± σ):     116.6 ms ±   1.8 ms    [User: 116.2 ms, System: 0.5 ms]
  Range (min … max):   114.1 ms … 119.0 ms    25 runs
Moelf commented 1 year ago

ld couldn't find -lgcc even though we installed gcc and build-base, according to:

niklas-heer commented 1 year ago

Even after adding all of this:

RUN apk add --no-cache clang lld libc-dev musl-dev compiler-rt compiler-rt-static alpine-sdk gcc hdf5-dev cmake

It didn't work. But with Debian, it does work. Adding a working commit.

Moelf commented 1 year ago

yeah something is not very robust in Static*.jl stuff, we can do this as a workaround before the fix, thanks btw!

Moelf commented 1 year ago

combined_results

looking sharp

niklas-heer commented 1 year ago

@Moelf you're very welcome. It could also be because of Alpine they use musl instead of something else the other distros use as far as I remember. I'm a bit fuzzy on the details. Yes, looks sharp. Going to merge it. Thank you again for your contribution. 👍

niklas-heer commented 1 year ago

Ah, found an article. It's musl instead of glibc, and they are using busybox which was developed for embedded systems. That's why it is such a tiny image (~3MB see latest image), but sometimes software doesn't work because of these shortcuts, so then it's good to fall back to Debian or Ubuntu.