3 ms·
I think this kind of thing demonstrates portability at a lower cost and better compile-time optimizations. You would think the other languages, especially C++ a
by Cyph0n 12y ago
I think this kind of thing demonstrates portability at a lower cost and better compile-time optimizations. You would think the other languages, especially C++ and Rust, would do better in the latter.
- oldmanjay 12y agoOptimizing for size often has an inverse impact on runtime, for instance if the compiler would have inlined heavily. edit: tense clarification
- pcwalton 12y agoThe real problem is that glibc has a hard time being statically linked. We just use the native system C library in Rust, which on Linux is usually glibc. We could focus on musl support in order to get true static linking, but there are much higher priority things like 1.0 stability, optimizations, and compiler performance (though we'd take a patch of course). The fact is that pure static linking is rarely done anymore, at least on mainstream desktop/mobile/server systems, so it's not on anybody's critical path. Dynamically linking to glibc does not really provide "better compile-time optimizations". LLVM already understands the libc functions that really benefit from inlining, like memcpy.