# Performance profiling

**URL:** https://discourse.kitware.com/t/performance-profiling/568
**Category:** Tips and Tricks
**Created:** [December 4, 2020, 6:49am UTC](https://discourse.kitware.com/t/performance-profiling/568 "2020-12-04T06:49:08Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [December 4, 2020, 6:49am UTC](https://discourse.kitware.com/t/performance-profiling/568/1 "2020-12-04T06:49:08Z")

</div>

In the past, several SMTK users have asked about tools to understand performance. Instruments on macos is excellent but if you aren’t having the performance problem on macos, it does you no good. On linux, oprofile is a headache to use.

I recently ran across [perf](https://perf.wiki.kernel.org/index.php/Main_Page) and [speedscope](https://github.com/jlfwong/speedscope), which have been wonderful! To set up, you install them

```auto
dnf install perf # for Fedora/RedHat systems
npm install speedscope

```

and then run the executable you want to profile:

```auto
perf record --call-graph fp -F 999 /path/to/executable args
perf script -i perf.data > profile.txt
speedscore

```

At the end, speedscore opens in your default browser; you click the “Browse” button and select `profile.txt`. Then you can see a flamegraph with time on the horizontal axis and the call stack on the vertical axis.
