Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

The following command

$ cargo build

produces a non-optimized build with debugging information. On the contrary,

$ cargo build --release

produces an optimized build without debugging information.

Is there a way of producing an optimized build with debugging information? I need this to get meaningful profiling information.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
868 views
Welcome To Ask or Share your Answers For Others

1 Answer

As shown in the Cargo documentation, modify the release profile to include debugging symbols:

[profile.release]
debug = true

Note that the release profile and the bench profile differ.

See also

Or basically any of the top search results for "rust profiling":


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...