I'm running Rust utilities that compiled with debug symbols.
cargo build
# without the "--release" flag
These are really slow compared to the same utilities written in C.
Is it possible that the debug symbols affected the performance?
I'm running Rust utilities that compiled with debug symbols.
cargo build
# without the "--release" flag
These are really slow compared to the same utilities written in C.
Is it possible that the debug symbols affected the performance?
Compiling with debug symbols will usually make your binary larger on Linux and UNIX-like platforms. This may mean that you need to load more data from disk, which can affect performance. There shouldn't really be any runtime difference.
You can split the debugging information into separate files to avoid increasing the size of your binaries. Windows does this by default with PDB files and macOS does this by default with dSYM files.
See also:
If you don't compile with --release
, your code will be slower. Compile with --release
if you are judging performance.
Switching between debug mode and release mode can change more than just debug symbols. The level of optimization is one example, overflow checking is another. To my knowledge, there's no complete list of what changes, other than reviewing the Cargo and Rust source code.
See also:
© 2022 - 2024 — McMap. All rights reserved.