Profiling tools

As for tooling, there seems to be no problem, Qt Creator integrates them already under the Analyze menu—the QML profiler, the CPU, the function profiler, and the memory analyzer. Unfortunately, this integration only works on Linux, as the tool used by Qt Creator is Valgrind, which is not available on Windows. The QML profiler is Qt native, but the other profilers won't work on Windows, so we have to look for some alternatives.

Now, the often-heard advice is to whip up a VM instance with Linux installed, and do your profiling there using Qt Creator's built-in Valgrind integration. In this book, we do not endorse such techniques because we aren't developing on Windows just to switch to Linux at the first opportunity. Though Qt draws an abstraction layer over different operating systems, underneath these are different platforms, with different implementations, and different behavior. We do not want to go profiling on another platform running the application in a VM to boot. However, for memory leaks detection, that could be a viable but labor-intensive option, so if there are any alternatives, we'd prefer to avoid it.

So, let's have a quick look at what tools we have at our disposal on our chosen platform.