Does the Rust compiler have a profiling option?

I have a Rust program that doesn't work as fast as I think. Is there a way to tell the compiler to get the binary to generate profiling information?

I mean something like GCC -pand -pgor GHC options -prof.

+4
source share
2 answers

The compiler does not support any form of tools specifically for profiling (for example, -p/ -pg/ -prof), but compiled Rust programs can be profiled using tools that do not require special tools, such as tools on OS X, as well as perf or callgrind on Linux.

I believe that such tools support DWARF debuginfo (as emitted -g) to provide more detailed performance diagnostics (for each line, etc.), but turning on optimizations leads to chaos with debugging information, and this never worked for me. When I analyze performance, immersion in asm is very common.

Making it easier would be very nice, and snap-in is a post-1.0 priority .

+5

, . , , . OS X Instruments . KCachegrind Linux .

+5

Source: https://habr.com/ru/post/1584951/


All Articles