mov rdx, len
mov rsi, msg
mov rdi, 1
mov rax, 1
mov rdi, 0
mov rax, 60
msg: db "hello world", 10
len: equ $-msg
0s real, 2 syscalls, 8.5 KiB of disk space required
Size of the instructions + data without the ELF wrapper: 52 bytes
@sir War on boilerplate.
@sir how good does lua do? The arch linux packages of both lua and luajit are only about 1MB. (gcc-libs of lua is large though, whereas luajit only needs readline.. oh needs some more behind that too)
don't forget to add the size of kernel
@Wolf480pl highly variable
@steph aye, which actually gets one too many syscalls but w/e
@steph crystal version and musl version please. Statically linked?
test.jl (linux, julia 1.3.0)
0.44s real, 2080 syscalls, 360MB is the current unpacked size of julia
If we measure using the time macro (i.e. speed and resources at runtime) it is
0.002s real, 1.97KiB used
I hope I did this right. Can you tell it's not made for this?
test.jl (linux, julia 1.3.1 and without silly configs)
0.122s real, 913 syscalls (41 unique), 344563 KiB
time macro outputs 0.009s, 1.98KiB
@steph what commands do I use to build this, and the static version?
@steph save me a little bit of effort, how many unique syscalls for both versions?
@steph thank you
@steph what is the size of the dynamic binary including any files required at runtime (libc, loader, etc)?
@steph thank you!
@sir so, basically, you're measuring the overhead of startup+teardown+issuing a single console print statement across a variety of languages?
@sir How do you print the memory usage?
@yabirgb this is disk usage, not memory use
@jeff not finished calculating disk usage for Java, but it's 0.07s real / 227 syscalls
rustc -C target-feature=+crt-static test.rs
real 0,002s, 97 syscalls, 3MiB
@yabirgb this rust command doesn't change anything for me
@kick these are arch except where musl is mentioned
test.hs (musl, statically linked):
main = putStrLn "Hello, World!"
(on the alpine docker image)
$ ghc -optl-static -optl-pthread -O2 test.hs
[1 of 1] Compiling Main ( test.hs, test.o )
Linking test ...
$ ldd test
/lib/ld-musl-x86_64.so.1: test: Not a valid dynamic program
$ du -sh test
$ strip test
$ du -sh test
$ strace test | wc -c
+++ exited with 0 +++
$ time ./test
real 0m 0.00s
user 0m 0.00s
sys 0m 0.00s
@pea -c(haracters or bytes), -w(ords), -l(ines)
@pea lines of a text file. Only -c is meaningful on binary files
The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!