2 ms·
It's still weird that it has significantly more syscalls than the C program dynamically linked to glibc, which presumably has the same overhead wrt ld.so and gu
by glandium 7y ago
It's still weird that it has significantly more syscalls than the C program dynamically linked to glibc, which presumably has the same overhead wrt ld.so and guard pages. (BTW, the guard page for the main thread, IIRC, is setup by the kernel)
- pcwalton 7y agoHere are the list of syscalls: https://gist.github.com/pcwalton/60ff97c2353feda11638be10118851f2 https://gist.github.com/pcwalton/60ff97c2353feda11638be10118... I think the extra syscalls you're referring to are the result of linking with pthread. Obviously Rust code always wants thread support. Here's the setup code: https://github.com/rust-lang/rust/blob/master/src/libstd/sys/unix/thread.rs https://github.com/rust-lang/rust/blob/master/src/libstd/sys... A fair number of the syscalls are to ensure that stack overflow is reported like a Rust panic (with a stack trace), not like a segv in unsafe code. I think this is worth it.