OProfile

OProfile is another great tool that can give us interesting information about our program. It's also only available for Linux, but you will find a similar tool for Windows too. Once again, if you can get a Linux partition to check this, your results will probably be more in line with what you will read next. To install it, install the oprofile package of your distribution. You might also need to install the generic Linux tools (linux-tools-generic in Ubuntu).

OProfile is not of much help without source annotations, so you should first compile your binary with them by using the following command:

cargo rustc --release --bin super-analyzer -- -g

You will need to be root to do the profiling, as it will directly get the kernel counters ...

Get Rust High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.