TIL: Running `cargo-flamegraph` With Tauri Apps

• 1 min read

A Tauri app is just a Rust-compiled binary. But because the Tauri workflow also involves some frontend development you normally develop your app using something like:

pnpm tauri dev

So when I had to profile my app, it wasn’t immediately obvious how to invoke flamegraph, but it’s really simple:

cargo install flamegraph
pnpm tauri build # use --debug if you want to profile your debug build

flamegraph --root -- /Users/samrat/code/myapp/src-tauri/target/release/myapp

The flamegraph.svg file will be produced once you close your app.

Be the first to cheers
Now look what you've done 🌋
Stop clicking and run for your life! 😱
Uh oh, I don't think the system can't handle it! 🔥
Stop it, you're too kind 😄
Thanks for the love! ❤️
Thanks, glad you enjoyed it! Care to share?
Hacker News Reddit

Hey 👋, thanks for reading!

I am currently looking for my next job.

If you know of someplace that might be a good fit for me, I'd really appreciate an intro: mail@samrat.me

Recommended Posts ✍🏻

See All »
• 6 min read
TIL: Sum Types With `instructor_ex`
Read Post »
• 1 min read
TIL: File Uploads Using the Req Elixir Library
Read Post »
• 1 min read
TIL: Creating `sentence-transformers` Embedding...
Read Post »