-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Description
LTO
In Rust, LTO is enabled:
lto = "fat" # Enables full link-time optimization for better inlining and dead code elimination across crates.While in C++ it isn't. Add this flag in CMakeLists:
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON)TUs count
In Rust version, there's only one TU, main.rs. While in C++ we have 5 files, and without LTO, inlines are not possible. LTO will fix TUs count problem, but maybe it will be even better to keep the code in 1 TU like in Rust version.
Compilers
C++ version may use different compilers depending on platform and toolchain. rustc is based on LLVM, so C++ should be compiled with a compiler based on LLVM too, which is clang++. Add an LLVM toolchain so compilers won't differ across platforms.
P.S. I didn't watch the video, a fellow of mine shared the comparison of C++ and Rust results and I started digging and noticed these omissions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels