1

I have a program that I optimized for better performance by using multi-threading via C++ execution policies. That way it now uses ~80% of the CPU, which is much better than the 10% before.

However, I want to take the next step and optimize more, using other techniques like better cache usage, better pipelining, etc. I roughly need to get better by another factor of 4 to 6.

To do so, I need a tool that can identify bottlenecks, count cache misses and the like.

The tool I'm looking for must work on Windows and be free of charge (gratis or open source). It must work with C++ and ideally be able to interpret PDB (program debug database) files in order to show me line numbers and source code.

It must support sampling and ideally also supports instrumentation. I'll start with sampling, though.

It does not need to support .NET (C++/CLI). It does not need to integrate into my IDE (which is Visual Studio). I actually prefer standalone tools.

I have tried:

  • Windows Performance Monitor. While it's some sort of useful, it does not specifically make use of PDBs and thus does not display source code or line numbers.
  • Windows Performance Recorder (WPR) and Windows Performance Analyzer (WPA) from the Windows Performance Toolkit (WPT). I feel like that's more a sysadmin tool rather a developer tool. No doubt it's good for PC troubleshooting, but not too useful for dep insights into a single program, IMHO.

1 Answer 1

1

Intel has had VTune and Advisor for a long time, but they made them free now as part of their OneAPI initiative.

VTune (emphasis mine)

[...] optimizes application performance, system performance, and system configuration for HPC, cloud, IoT, media, storage, and more.

CPU, GPU, and FPGA: Tune the entire application’s performance―not just the accelerated portion.

Multilingual: Profile SYCL*, C, C++, [...] Assembly, or any combination of languages.

System or Application: Get coarse-grained system data for an extended period or detailed results mapped to source code.

Power: Optimize performance while avoiding power- and thermal-related throttling.

Advisor is

[...] a design and analysis tool for developing performant code. The tool supports C, C++, [...] and Python*. It helps with the following:

Performant CPU Code: Design your application for efficient threading, vectorization, and memory use.

Efficient GPU Offload: Identify parts of the code that can be profitably offloaded. Optimize the code for compute and memory.

Flow Graph Design and Analysis: Create, visualize, and analyze task and dependency computation for heterogeneous algorithms.

I recommend using them both, because they complement each other. Both run on Windows as required.

I've used them to do a memory layout transformation from AoS to SoA and that gave a performance boot of a factor 2 to 3. The tools really helped identifying the root causes like random memory access instead of uniform access. However, for a performance beginner, all the terms and options can be a bit overwhelming.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.