Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why is 'cargo flamegraph' running about 45x faster than cargo run (after cargo build –release)?

Until this morning, ‘cargo flamegraph’ was a bit slower than ‘cargo run’ after ‘cargo build –release’.

I made a small change, swapping out:

std::collections::{HashMap, HashSet};

with:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

rustc_hash::{FxHashMap, FxHashSet};

But, I can’t think why this (or anything really) could possibly cause ‘cargo flamegraph’ to suddenly and dramatically outperform ‘cargo run’.

>Solution :

cargo run will build in debug mode and run that.

If you want to run release, either use the artifact target/release/project_name[.exe], or execute cargo run --release.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading