3 ms·
$ cat hello.tl (pprinl "hello, world") $ strace txr hello.tl 2>&1 > /dev/null | wc -l 77 $ cat hello.c #include <stdio.h> int main(void) { printf("
by kazinator 11y ago
$ cat hello.tl
(pprinl "hello, world")
$ strace txr hello.tl 2>&1 > /dev/null | wc -l
77
$ cat hello.c
#include <stdio.h>
int main(void) { printf("Hello, world\n"); }
$ cc -O hello.c -o hello
$ strace ./hello 2>&1 > /dev/null | wc -l
29
$ strace gawk 'BEGIN { print "hello") }' 2>&1 > /dev/null | wc -l
84
- nmjohn 11y ago$ strace node -e 'console.log("hello world")' 2>&1 > /dev/null | wc -l 304
- catwell 11y ago$ strace lua5.3 -e 'print("hello")' 2>&1 > /dev/null | wc -l 67
- kazinator 11y ago$ strace txr -e '(put-line "hello")' 2>&1 > /dev/null | wc -l 70 Very similar. Obviously there are those who care about reasonable startup times and, ... others. :) By the way, TXR supports setuid operation, and so it makes a few extra syscalls to check its security situation (am I running setuid? setgid?)
- jandrese 11y ago$ cat HelloWorld.java public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world"); } } $ strace java HelloWorld 2>&1 > /dev/null | wc -l 122
- jaytaylor 11y ago$ strace python -c "print('hello world')" 2>&1 > /dev/null | wc -l 924 $ strace python3 -c "print('hello world')" 2>&1 > /dev/null | wc -l 543
- deleted 11y ago[deleted]
- jandrese 11y agoWow, that's bad even by interpreted language standards: % strace perl -e "print 'Hello, World';" 2>&1 > /dev/null | wc -l 192
- jamesdutc 11y agoPython's site module contributes a lot to this. It attempts to load a lot of other modules, many of which may not exist for a given install. Using your example: $ strace python3 -c 'print("hello world", end="")' 2>&1 | hist 1. stat 122 2. rt_sigaction 68 3. fstat 67 4. read 55 5. close 47 6. open 37 7. mmap 34 8. lseek 30 9. getdents 18 10. mprotect 16 ... TOTAL: 567 $ strace python3 -S -c 'print("hello world", end="")' 2>&1 | hist 1. rt_sigaction 68 2. stat 51 3. fstat 39 4. mmap 31 5. read 27 6. close 26 7. open 23 8. mprotect 16 9. lseek 15 10. brk 10 ... TOTAL: 350