Clojure Start Syscalls

Inspired by a recent article comparing the number of system calls at start made by various compilers, I decided to do the same with my Clojure start-time experiments.

Native compilation with GraalVM didn’t work in my Linux VM, and I didn’t spend a lot of time on it, but I imagine the numbers would be similar as for Babashka.

At first I just measured the total number of system calls with strace -c. Then I remembered that most of these runtimes are multi-threaded, so I ran again with strace -f -c.

RuntimeSyscallswith -f
Java1481838
Leiningen76384,306
Clojure CLI67336,609
Planck531513,304
Lumo24883472
Joker185434
Babashka144201
Ferret5757
C2727

Interestingly, these numbers do not correlate with the running times from my last experiment. Clearly, the number of system calls doesn’t tell you anything about how long a particular program takes to run.

As before, these are not comprehensive benchmarks. The actual number of system calls varies from one run to the next; this is just one sample.

I’m no expert on Linux system calls, but when I glanced over the output of strace it looked like the most common calls were about setting up memory: madvise, mprotect, mmap, etc.