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
.
Runtime | Syscalls | with -f |
Java | 148 | 1838 |
Leiningen | 763 | 84,306 |
Clojure CLI | 673 | 36,609 |
Planck | 5315 | 13,304 |
Lumo | 2488 | 3472 |
Joker | 185 | 434 |
Babashka | 144 | 201 |
Ferret | 57 | 57 |
C | 27 | 27 |
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.